diff options
author | Mohamed Ashraf <mohamed.ashraf.213@gmail.com> | 2013-06-29 14:41:44 +0400 |
---|---|---|
committer | Mohamed Ashraf <mohamed.ashraf.213@gmail.com> | 2013-06-29 14:41:44 +0400 |
commit | 26bab09ef3756e53c90f0f36e49e440fd1e9518d (patch) | |
tree | e83e02fab061157c453450d7a1336407758d2a77 /js/error_report.js | |
parent | cc2558b9a7022c7b9eeebd39ff947840dc42efab (diff) |
Added function to wrap JQuery.fn.on callback
Diffstat (limited to 'js/error_report.js')
-rw-r--r-- | js/error_report.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/js/error_report.js b/js/error_report.js index 205ca7a115..1cc37ba666 100644 --- a/js/error_report.js +++ b/js/error_report.js @@ -243,7 +243,7 @@ var ErrorReport = { }, /** * Automatically wraps the callback in AJAX.registerOnload - * + * * @return void */ _wrap_ajax_onload_callback: function() { @@ -254,6 +254,23 @@ var ErrorReport = { } }, /** + * Automatically wraps the callback in $.fn.on + * + * @return void + */ + _wrap_$_on_callback: function() { + var oldOn = $.fn.on; + $.fn.on = function() { + for( var i = 1; i<=3; i++) { + if(typeof(arguments[i]) === "function") { + arguments[i] = ErrorReport.wrap_function(arguments[i]); + break; + } + } + return oldOn.apply(this, arguments); + } + }, + /** * Wraps all global functions that start with PMA_ * also automatically wraps the callback in AJAX.registerOnload * @@ -262,6 +279,7 @@ var ErrorReport = { set_up_error_reporting: function () { ErrorReport.wrap_global_functions(); ErrorReport._wrap_ajax_onload_callback(); + ErrorReport._wrap_$_on_callback(); } } |