From 3c5340d146100dab8c69d2c2c1925adca827342a Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Thu, 31 May 2007 04:15:41 +0000 Subject: [PATCH] Fix for #1185 --- src/event/event.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/event/event.js b/src/event/event.js index fe4357969..623bcf32a 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -41,7 +41,17 @@ jQuery.event = { if (!element.$handle) element.$handle = function() { - jQuery.event.handle.apply(element, arguments); + // returned undefined or false + var val; + + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + if ( typeof jQuery == "undefined" || jQuery.event.triggered ) + return val; + + val = jQuery.event.handle.apply(element, arguments); + + return val; }; // Get the current list of functions bound to this event @@ -138,7 +148,7 @@ jQuery.event = { data.unshift( this.fix({ type: type, target: element }) ); // Trigger the event - if ( (val = this.handle.apply( element, data )) !== false ) + if ( (val = element.$handle.apply( element, data )) !== false ) this.triggered = true; if ( fn && val !== false && !jQuery.nodeName(element, 'a') ) @@ -151,11 +161,6 @@ jQuery.event = { handle: function(event) { // returned undefined or false var val; - - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - if ( typeof jQuery == "undefined" || jQuery.event.triggered ) - return val; // Empty object is for triggered events with no data event = jQuery.event.fix( event || window.event || {} );