]> source.dussan.org Git - jquery.git/commitdiff
Made sure that $.event.handle() always has some form of an event object.
authorJohn Resig <jeresig@gmail.com>
Wed, 17 May 2006 18:48:23 +0000 (18:48 +0000)
committerJohn Resig <jeresig@gmail.com>
Wed, 17 May 2006 18:48:23 +0000 (18:48 +0000)
jquery/jquery.js

index 4592c1bf3bea6a0fda5a854681f07c95350637e4..fe12bf73b21b939932add19d41df20648a32e671 100644 (file)
@@ -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 ) {