Use jQuery.ajaxStop instead of Wicket global events

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/cdef2c36
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/cdef2c36
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/cdef2c36

Branch: refs/heads/master
Commit: cdef2c36deacbb4fa3ab20005165d681eee4b82a
Parents: 3e48fac
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Mon Jun 17 14:35:51 2013 +0200
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Mon Jun 17 14:35:51 2013 +0200

----------------------------------------------------------------------
 wicket-examples/src/main/webapp/js-test/lib/gym.js | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/cdef2c36/wicket-examples/src/main/webapp/js-test/lib/gym.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/lib/gym.js 
b/wicket-examples/src/main/webapp/js-test/lib/gym.js
index 51da391..dfcb5c3 100644
--- a/wicket-examples/src/main/webapp/js-test/lib/gym.js
+++ b/wicket-examples/src/main/webapp/js-test/lib/gym.js
@@ -92,15 +92,12 @@
        // private
        var _onAjaxComplete = function(iframe, toExecute) {
 
-               // unregister any leaked subscriber
-               iframe.jQuery(iframe.document).off('/ajax/call/complete');
+               iframe.jQuery(iframe.document).off("ajaxStop");
 
-               // register the requested subscriber
-               iframe.Wicket.Event.subscribe('/ajax/call/complete', 
function(jqEvent, attributes, jqXHR, textStatus) {
-                       // immediately unregister this subscriber
-                       
iframe.jQuery(iframe.document).off('/ajax/call/complete');
+               iframe.jQuery(iframe.document).ajaxStop(function() {
 
-                       // call back
+                       iframe.jQuery(iframe.document).off("ajaxStop");
+                       
                        var $$ = iframe.jQuery || _jQueryWithContext;
                        toExecute($$);
                });

Reply via email to