From 1fc26eb1d57ab2e6d49c5121414090b596ba2f8d Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Wed, 8 Feb 2012 19:52:04 +0100 Subject: [PATCH] [feature/ajax] Make quick-mod tools "exception" handling more explicit PHPBB3-10270 --- phpBB/styles/prosilver/template/ajax.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 3e431a0c6e..53dc8e1124 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -70,18 +70,22 @@ $('[data-ajax]').each(function() { phpbb.ajaxify({ selector: '#quickmodform', exception: function(act, data) { - var action = $('#quick-mod-select').val() + var action = $('#quick-mod-select').val(); + if (action === 'make_normal') { return !($(this).find('select option[value="make_global"]').length); } - else if (action.slice(-4) === 'lock') + else if (action === 'lock' || action === 'unlock') { - // Return false for both lock and unlock return false; } - // make_sticky, make_announce and make_global all use AJAX. - return !(action === 'delete_topic' || action.slice(0, 5) === 'make_'); + + if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') { + return false; + } + + return true; } }, true);