X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=inline;f=src%2Fevent.js;h=230af19e01fab10bd839c69ab46fd95ec4c66b7f;hb=48164ee603bc4ec17f2fb72571c531ebdc7213ae;hp=e46e1086c8dde2942c6114c0b39067a9154c91f7;hpb=c2fad371f1eb9e3204f5901d1dca056bbe4f389f;p=jquery.git diff --git a/src/event.js b/src/event.js index e46e108..230af19 100644 --- a/src/event.js +++ b/src/event.js @@ -240,7 +240,8 @@ jQuery.event = { var all, handlers; event = arguments[0] = jQuery.event.fix( event || window.event ); - + event.currentTarget = this; + // Namespaced event handlers var namespaces = event.type.split("."); event.type = namespaces.shift(); @@ -377,13 +378,13 @@ jQuery.Event = function( src ){ if( src && src.type ){ this.originalEvent = src; this.type = src.type; - this.timeStamp = src.timeStamp; // Event type }else this.type = src; - if( !this.timeStamp ) - this.timeStamp = now(); + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = now(); // Mark it as fixed this[expando] = true; @@ -571,10 +572,14 @@ function liveHandler( event ){ } }); + elems.sort(function(a,b) { + return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest"); + }); + jQuery.each(elems, function(){ - if ( !event.isImmediatePropagationStopped() && - this.fn.call(this.elem, event, this.fn.data) === false ) - stop = false; + event.currentTarget = this.elem; + if ( this.fn.call(this.elem, event, this.fn.data) === false ) + return (stop = false); }); return stop; @@ -638,7 +643,7 @@ function bindReady(){ // If IE and not an iframe // continually check to see if the document is ready - if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){ + if ( document.documentElement.doScroll && window == window.top ) (function(){ if ( jQuery.isReady ) return; try {