mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-27 11:22:17 -05:00
Add a autoclose parameters. When we use sharing method in plugins like the tiny tiny rss one or the firefox plugins we can passe the autoclose=true parameters that close the popup.
This commit is contained in:
parent
2b191d8c37
commit
363bc4eb86
@ -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) {
|
||||
if ($autoclose == TRUE) {
|
||||
Tools::redirect('?view=home');
|
||||
} else {
|
||||
Tools::redirect('?view=home&autoclose=true');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
|
@ -8,3 +8,4 @@
|
||||
<link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/messages.css" media="all">
|
||||
<link rel="stylesheet" href="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/css/print.css" media="print">
|
||||
<script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/jquery-2.0.3.min.js"></script>
|
||||
<script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/autoClose.js"></script>
|
6
themes/default/js/autoClose.js
Normal file
6
themes/default/js/autoClose.js
Normal file
@ -0,0 +1,6 @@
|
||||
$(document).ready(function() {
|
||||
current_url = window.location.href
|
||||
if (current_url.match("&autoclose=true")) {
|
||||
window.close();
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user