From d29c7cd0a8dd9f4bac86423fdbf06ecabcbc58f8 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Wed, 1 Jun 2011 09:59:48 +0000 Subject: plugin manager: "Deactivate all" button now works git-svn-id: http://piwigo.org/svn/trunk@11184 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/plugins_installed.tpl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'admin/themes/default') diff --git a/admin/themes/default/template/plugins_installed.tpl b/admin/themes/default/template/plugins_installed.tpl index c7480a9e7..5741365d5 100644 --- a/admin/themes/default/template/plugins_installed.tpl +++ b/admin/themes/default/template/plugins_installed.tpl @@ -11,9 +11,10 @@ var confirmMsg = '{'Are you sure?'|@translate|@escape:'javascript'}'; {literal} var queuedManager = jQuery.manageAjax.create('queued', { queue: true, - maxRequests: 1, - complete: function() { location.reload(); } + maxRequests: 1 }); +var nb_plugins = jQuery('div.active').size(); +var done = 0; jQuery(document).ready(function() { /* group action */ @@ -31,9 +32,9 @@ jQuery(document).ready(function() { url: 'ws.php', data: { method: 'pwg.plugins.performAction', action: 'deactivate', plugin: id, pwg_token: pwg_token, format: 'json' }, success: function(data) { - if (data['stat'] == 'ok') { - jQuery("#"+id).removeClass('active').addClass('inactive'); - } + if (data['stat'] == 'ok') jQuery("#"+id).removeClass('active').addClass('inactive'); + done++; + if (done == nb_plugins) location.reload(); } }); }; @@ -106,7 +107,7 @@ jQuery(document).ready(function() { {if $field_name != $plugin.STATE} {if $field_name != 'null'} - {if $field_name == 'active'}
{'Deactivate'|@translate} {'all'|@translate}
{/if} + {if $field_name == 'active'}
{'Deactivate all'|@translate}
{/if} {/if} @@ -134,7 +135,7 @@ jQuery(document).ready(function() { {/if} {if $plugin_display == 'complete'} -
+
@@ -181,7 +182,7 @@ jQuery(document).ready(function() { {assign var='version' value=$plugin.VERSION} {/if} -
+
{$plugin.NAME} i -- cgit v1.2.3