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 = {}; } };