Skip to content

Commit

Permalink
feat(browserTrigger): allow support for custom timeStamps in events
Browse files Browse the repository at this point in the history
  • Loading branch information
matsko committed Sep 25, 2013
1 parent 6c59e77 commit a7ccaf3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ngScenario/browserTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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);
}
}
}
Expand All @@ -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,
Expand Down

0 comments on commit a7ccaf3

Please sign in to comment.