From af8601b085d175d58a41e9286f056b6a330c8e81 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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/neon-animation-runner-behavior.html b/neon-animation-runner-behavior.html index 67c11b6..b8059a4 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) { @@ -113,11 +113,13 @@ /** * Cancels the currently running animations. */ - cancelAnimation: function() { - for (var k in this._animations) { - this._animations[k].cancel(); + cancelAnimation: function(cookie) { + 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 = {}; } };