From 03d4ae20d1fc98b43edfdf26ae2a2379e52b3182 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sat, 22 Oct 2011 17:18:09 +0100 Subject: [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 --- phpBB/assets/javascript/core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/assets/javascript') diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index a1447af491..a8ccad863f 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -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; } -- cgit v1.2.1