From 42f46ed1d5bc6fc828f0b30994505edd1e63c1f1 Mon Sep 17 00:00:00 2001 From: Derek Schmidt Date: Mon, 19 Dec 2016 12:48:28 -0700 Subject: [PATCH] Fix #215 by using _active --- neon-animation-runner-behavior.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/neon-animation-runner-behavior.html b/neon-animation-runner-behavior.html index 67c11b6..75e7549 100644 --- a/neon-animation-runner-behavior.html +++ b/neon-animation-runner-behavior.html @@ -32,7 +32,7 @@ try { result = neonAnimation.configure(config); // Check if we have an Effect rather than an Animation - if (typeof result.cancel != 'function') { + if (typeof result.cancel != 'function') { result = document.timeline.play(result); } } catch (e) { @@ -114,10 +114,12 @@ * Cancels the currently running animations. */ cancelAnimation: function() { - for (var k in this._animations) { - this._animations[k].cancel(); + for (var k in this._active) { + for (var i in this._active[k]){ + this._active[k][i].animation.cancel(); + } + delete this._active[k]; } - this._animations = {}; } };