1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/10271] Started using .call for javascript callbacks.

Previously, they were just being called by appending parentheses and
functions. Now, they're being called and the element is being set as the
context instead of a parameter. It's a lot cleaner.

PHPBB3-10271
This commit is contained in:
Callum Macrae
2011-10-22 17:18:09 +01:00
committed by Igor Wiedler
parent e0d6814772
commit 03d4ae20d1
3 changed files with 25 additions and 26 deletions

View File

@@ -265,7 +265,7 @@ phpbb.ajaxify = function(options, refresh, callback) {
if (typeof phpbb.ajax_callbacks[callback] === 'function')
{
phpbb.ajax_callbacks[callback](that, res, (is_form) ? act : null);
phpbb.ajax_callbacks[callback].call(that, res, (is_form) ? act : null);
}
if (res.REFRESH_DATA)
@@ -322,7 +322,7 @@ phpbb.ajaxify = function(options, refresh, callback) {
data += '&' + this.name + '=' + this.value;
}
if (run_exception && options.exception($this.parents('form'), action, data))
if (run_exception && options.exception.call($this.parents('form')[0], action, data))
{
return true;
}
@@ -331,7 +331,7 @@ phpbb.ajaxify = function(options, refresh, callback) {
}
else
{
if (run_exception && options.exception($this))
if (run_exception && options.exception.call(this))
{
return true;
}