Commit c7a14f13 authored by Ariel Flesler's avatar Ariel Flesler

jquery event: event.timeStamp wasn't being created when passing just the type to the constructor.

Misc: Simplified the readyList execution code.
parent c0446c70
...@@ -399,13 +399,14 @@ jQuery.Event = function( src ){ ...@@ -399,13 +399,14 @@ jQuery.Event = function( src ){
if( src && src.type ){ if( src && src.type ){
this.originalEvent = src; this.originalEvent = src;
this.type = src.type; this.type = src.type;
this.timeStamp = src.timeStamp;
// Fix timeStamp
this.timeStamp = src.timeStamp || now();
// Event type // Event type
}else }else
this.type = src; this.type = src;
if( !this.timeStamp )
this.timeStamp = now();
// Mark it as fixed // Mark it as fixed
this[expando] = true; this[expando] = true;
}; };
...@@ -559,7 +560,7 @@ jQuery.fn.extend({ ...@@ -559,7 +560,7 @@ jQuery.fn.extend({
// Otherwise, remember the function for later // Otherwise, remember the function for later
else else
// Add the function to the wait list // Add the function to the wait list
jQuery.readyList.push( function() { return fn.call(this, jQuery); } ); jQuery.readyList.push( fn );
return this; return this;
}, },
...@@ -607,7 +608,7 @@ jQuery.extend({ ...@@ -607,7 +608,7 @@ jQuery.extend({
if ( jQuery.readyList ) { if ( jQuery.readyList ) {
// Execute all of them // Execute all of them
jQuery.each( jQuery.readyList, function(){ jQuery.each( jQuery.readyList, function(){
this.call( document ); this.call( document, jQuery );
}); });
// Reset the list of functions // Reset the list of functions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment