Skip to main content

Bug Tracker

Side navigation

Ticket #1185: jquery.event.diff
File jquery.event.diff, 1.4 KB (added by brandon, May 15, 2007 12:58PM UTC)
Index: src/event/event.js
===================================================================
--- src/event/event.js	(revision 1906)
+++ src/event/event.js	(working copy)
@@ -44,7 +44,17 @@
 		
 		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
@@ -135,7 +145,7 @@
 			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') )
@@ -148,11 +158,6 @@
 	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 || {} );

Download in other formats:

Original Format