From b8e974885175d1d46f9d96800ebf895d7eac21aa Mon Sep 17 00:00:00 2001 From: Vladislav Shabanov Date: Mon, 30 Mar 2015 16:46:17 +0700 Subject: [PATCH] Force finish ongoing transition when change selected --- core-animated-pages.html | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/core-animated-pages.html b/core-animated-pages.html index d55487f..ed21a10 100644 --- a/core-animated-pages.html +++ b/core-animated-pages.html @@ -324,8 +324,7 @@ applyTransition: function(src, dst) { if (this.animating) { - this.cancelAsync(this.animating); - this.animating = null; + this.complete(); } Polymer.flush(); @@ -391,23 +390,22 @@ transition.ensureComplete(this); }, this); + // force layout! + this.offsetTop; + this.fire('core-animated-pages-transition-end'); }, transitionEnd: function(e) { - if (this.transitioning.length) { - var completed = true; - this._transitionElements.forEach(function(transition) { - if (!transition.completed) { - completed = false; - } - }); - if (completed) { - this.job('transitionWatch', function() { - this.complete(); - }, 100); - } + if (!this.transitioning.length) + return; + + for (var i=0; i