aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-09-08 15:59:23 -0400
committertimmywil <timmywillisn@gmail.com>2011-09-19 15:42:32 -0400
commit8c91da57b9fbc8ded9854a899e4105530cea1d90 (patch)
treed331389ff7d7e0588db914ca70d85c5e90376903 /src
parent619a89d5ff6f5bcf678bdb88c3b47dea96b06ea7 (diff)
downloadjquery-8c91da57b9fbc8ded9854a899e4105530cea1d90.tar.gz
jquery-8c91da57b9fbc8ded9854a899e4105530cea1d90.zip
Fix #9593. Create a new jQuery.Event rather than a plain object when simulate()ing events. Fix a related issue with not passing src to jQuery.Event constructor.
Diffstat (limited to 'src')
-rw-r--r--src/event.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index 4b50f93a2..688aa9fb0 100644
--- a/src/event.js
+++ b/src/event.js
@@ -644,7 +644,7 @@ jQuery.Event = function( src, props ) {
}
// Create a timestamp if incoming event doesn't have one
- this.timeStamp = src.timeStamp || jQuery.now();
+ this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
@@ -875,7 +875,7 @@ function simulate( type, elem, event, bubble ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend( {}, event, { type: type, originalEvent: {} } );
+ var e = jQuery.extend( new jQuery.Event(), event, { type: type, originalEvent: {} } );
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {