feat(browserTrigger): allow support for custom timeStamps in events

This commit is contained in:
Matias Niemelä 2013-09-25 00:20:18 -04:00 committed by Misko Hevery
parent 3b3e89d5d6
commit acc2fb8486

View file

@ -101,7 +101,7 @@
}
catch(e) {
evnt = document.createEvent('TransitionEvent');
evnt.initTransitionEvent(eventType, null, null, null, eventData.elapsedTime);
evnt.initTransitionEvent(eventType, null, null, null, eventData.elapsedTime || 0);
}
}
}
@ -116,7 +116,7 @@
}
catch(e) {
evnt = document.createEvent('AnimationEvent');
evnt.initAnimationEvent(eventType, null, null, null, eventData.elapsedTime);
evnt.initAnimationEvent(eventType, null, null, null, eventData.elapsedTime || 0);
}
}
}
@ -128,6 +128,11 @@
pressed('shift'), pressed('meta'), 0, element);
}
/* we're unable to change the timeStamp value directly so this
* is only here to allow for testing where the timeStamp value is
* read */
evnt.$manualTimeStamp = eventData.timeStamp;
if(!evnt) return;
var originalPreventDefault = evnt.preventDefault,