diff options
author | Ariel Flesler <aflesler@gmail.com> | 2008-12-31 03:36:51 +0000 |
---|---|---|
committer | Ariel Flesler <aflesler@gmail.com> | 2008-12-31 03:36:51 +0000 |
commit | c7a14f13916ca8ed22f9bb6fe40fa104b370211f (patch) | |
tree | e9df84e27adca1a48b8b80a0eeaf7e9b4f534e18 /src/event.js | |
parent | c0446c70d52fe2afd74b2f95c384ae238c48ad09 (diff) | |
download | jquery-c7a14f13916ca8ed22f9bb6fe40fa104b370211f.tar.gz jquery-c7a14f13916ca8ed22f9bb6fe40fa104b370211f.zip |
jquery event: event.timeStamp wasn't being created when passing just the type to the constructor.
Misc: Simplified the readyList execution code.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/event.js b/src/event.js index 5f4b807cf..97565a84a 100644 --- a/src/event.js +++ b/src/event.js @@ -399,13 +399,14 @@ jQuery.Event = function( src ){ if( src && src.type ){ this.originalEvent = src; this.type = src.type; - - // Fix timeStamp - this.timeStamp = src.timeStamp || now(); + this.timeStamp = src.timeStamp; // Event type }else this.type = src; + if( !this.timeStamp ) + this.timeStamp = now(); + // Mark it as fixed this[expando] = true; }; @@ -559,7 +560,7 @@ jQuery.fn.extend({ // Otherwise, remember the function for later else // Add the function to the wait list - jQuery.readyList.push( function() { return fn.call(this, jQuery); } ); + jQuery.readyList.push( fn ); return this; }, @@ -607,7 +608,7 @@ jQuery.extend({ if ( jQuery.readyList ) { // Execute all of them jQuery.each( jQuery.readyList, function(){ - this.call( document ); + this.call( document, jQuery ); }); // Reset the list of functions |