diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 39d4376..5d80726 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -327,7 +327,7 @@ class Poche /** * Call action (mark as fav, archive, delete, etc.) */ - public function action($action, Url $url, $id = 0, $import = FALSE) + public function action($action, Url $url, $id = 0, $import = FALSE, $autoclose = FALSE) { switch ($action) { @@ -358,7 +358,11 @@ class Poche } if (!$import) { - Tools::redirect('?view=home'); + if ($autoclose == TRUE) { + Tools::redirect('?view=home'); + } else { + Tools::redirect('?view=home&autoclose=true'); + } } break; case 'delete': diff --git a/themes/default/_head.twig b/themes/default/_head.twig index d0cbd32..577cc69 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -8,3 +8,4 @@ + \ No newline at end of file diff --git a/themes/default/js/autoClose.js b/themes/default/js/autoClose.js new file mode 100644 index 0000000..3035d42 --- /dev/null +++ b/themes/default/js/autoClose.js @@ -0,0 +1,6 @@ +$(document).ready(function() { + current_url = window.location.href + if (current_url.match("&autoclose=true")) { + window.close(); + } +}); \ No newline at end of file