From 81fda970ff9d5c820995aa0ea3f873b8c801f47b Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 17 May 2006 18:48:23 +0000 Subject: [PATCH] Made sure that $.event.handle() always has some form of an event object. --- jquery/jquery.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jquery/jquery.js b/jquery/jquery.js index 4592c1b..fe12bf7 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -781,12 +781,15 @@ $.event.trigger = function(element,type,data) { }; $.event.handle = function(event) { - var returnValue = true; + if ( !event && !window.event ) { return null; } + + var returnValue = true, handlers = []; event = event || $.event.fix(window.event); - var handlers = []; + for ( var j in this.events[event.type] ) { handlers[handlers.length] = this.events[event.type][j]; } + for ( var i = 0; i < handlers.length; i++ ) { try { if ( handlers[i].constructor == Function ) { -- 1.7.10.4