Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(ngMock.browserTrigger): add 'bubbles' to Transition/Animation Event
Browse files Browse the repository at this point in the history
When the event objects are created synthetically, the bubbles property is set to false
if not explicitly defined
  • Loading branch information
Narretz committed Sep 6, 2017
1 parent bf78bee commit 7a5f06d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ngMock/browserTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@
if (/transitionend/.test(eventType)) {
if (window.WebKitTransitionEvent) {
evnt = new window.WebKitTransitionEvent(eventType, eventData);
evnt.initEvent(eventType, false, true);
evnt.initEvent(eventType, eventData.bubbles, true);
} else {
try {
evnt = new window.TransitionEvent(eventType, eventData);
} catch (e) {
evnt = window.document.createEvent('TransitionEvent');
evnt.initTransitionEvent(eventType, null, null, null, eventData.elapsedTime || 0);
evnt.initTransitionEvent(eventType, eventData.bubbles, null, null, eventData.elapsedTime || 0);
}
}
} else if (/animationend/.test(eventType)) {
if (window.WebKitAnimationEvent) {
evnt = new window.WebKitAnimationEvent(eventType, eventData);
evnt.initEvent(eventType, false, true);
evnt.initEvent(eventType, eventData.bubbles, true);
} else {
try {
evnt = new window.AnimationEvent(eventType, eventData);
} catch (e) {
evnt = window.document.createEvent('AnimationEvent');
evnt.initAnimationEvent(eventType, null, null, null, eventData.elapsedTime || 0);
evnt.initAnimationEvent(eventType, eventData.bubbles, null, null, eventData.elapsedTime || 0);
}
}
} else if (/touch/.test(eventType) && supportsTouchEvents()) {
Expand Down

0 comments on commit 7a5f06d

Please sign in to comment.