[feature/ajax] Make quick-mod tools "exception" handling more explicit

PHPBB3-10270
This commit is contained in:
Igor Wiedler 2012-02-08 19:52:04 +01:00
parent d96b07a745
commit 1fc26eb1d5

View file

@ -70,18 +70,22 @@ $('[data-ajax]').each(function() {
phpbb.ajaxify({ phpbb.ajaxify({
selector: '#quickmodform', selector: '#quickmodform',
exception: function(act, data) { exception: function(act, data) {
var action = $('#quick-mod-select').val() var action = $('#quick-mod-select').val();
if (action === 'make_normal') if (action === 'make_normal')
{ {
return !($(this).find('select option[value="make_global"]').length); 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; 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); }, true);