mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
[feature/ajax] Change filter semantics, some minor adjustments
PHPBB3-10270
This commit is contained in:
parent
de82608e6f
commit
2f25173d93
2 changed files with 9 additions and 9 deletions
|
@ -338,7 +338,7 @@ phpbb.ajaxify = function(options) {
|
||||||
{
|
{
|
||||||
action = $this.attr('action').replace('&', '&');
|
action = $this.attr('action').replace('&', '&');
|
||||||
data = $this.serializeArray();
|
data = $this.serializeArray();
|
||||||
method = $this.attr('method');
|
method = $this.attr('method') || 'GET';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -347,7 +347,7 @@ phpbb.ajaxify = function(options) {
|
||||||
method = 'GET';
|
method = 'GET';
|
||||||
}
|
}
|
||||||
|
|
||||||
// If filter function returns true, cancel the AJAX functionality,
|
// If filter function returns false, cancel the AJAX functionality,
|
||||||
// and return true (meaning that the HTTP request will be sent normally).
|
// and return true (meaning that the HTTP request will be sent normally).
|
||||||
if (run_filter && options.filter.call(this, data))
|
if (run_filter && options.filter.call(this, data))
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,25 +73,25 @@ $('[data-ajax]').each(function() {
|
||||||
*/
|
*/
|
||||||
phpbb.ajaxify({
|
phpbb.ajaxify({
|
||||||
selector: '#quickmodform',
|
selector: '#quickmodform',
|
||||||
filter: function(data) {
|
refresh: true,
|
||||||
|
filter: function (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 > 0;
|
||||||
}
|
}
|
||||||
else if (action === 'lock' || action === 'unlock')
|
else if (action === 'lock' || action === 'unlock')
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') {
|
if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
},
|
}
|
||||||
refresh: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue