Skip to content

Commit

Permalink
deal with chrome prefix events
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrewrs committed Nov 18, 2014
1 parent 1ed6f7d commit 533512b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flare.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,10 @@
show(animationContainer);
logoContainer.classList.add('hidden-background');

var evtName = typeof document.webkitHidden === typeof !1 ? 'webkitAnimationEnd' : 'animationend';
// animationend => webkitAnimationEnd
function onAnimationEnd() {
frames.removeEventListener('animationend', onAnimationEnd);
frames.removeEventListener(evtName, onAnimationEnd);
frames.classList.remove('animate');
hide(animationContainer);
logoContainer.classList.remove('hidden-background');
Expand All @@ -301,7 +302,7 @@
}
}
var frames = animation.querySelector('.frames');
frames.addEventListener('animationend', onAnimationEnd);
frames.addEventListener(evtName, onAnimationEnd);
frames.classList.add('animate');
}
runAnimation.queue = [];
Expand Down

0 comments on commit 533512b

Please sign in to comment.