From 117c209effdf4ff39fe8ef7f54b0bb6da03d9fc5 Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Wed, 23 Apr 2014 13:38:37 -0700 Subject: [PATCH] update to use web animations 'finish' event --- polymer-ui-animated-pages.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer-ui-animated-pages.html b/polymer-ui-animated-pages.html index e41f848..2a199af 100644 --- a/polymer-ui-animated-pages.html +++ b/polymer-ui-animated-pages.html @@ -77,7 +77,8 @@ applyTransition: function() { if (this.prevSelectedItem) { this.animation = this.makeTransitionAnimation(); - document.timeline.play(this.animation); + var player = document.timeline.play(this.animation); + player.onfinish = this.animationEndAction.bind(this); // Apply the class after the animation starts playing to prevent // a flicker at the end of the animation. this.async(function() { @@ -115,7 +116,6 @@ fill: 'none', direction: direction }); - animation.onend = this.animationEndAction.bind(this); return animation; }, selectedItemChanged: function(oldItem) {