From 014d4df1f2294cdad3c1c324585bc0eef0a14ad4 Mon Sep 17 00:00:00 2001 From: Keldon Jones Date: Fri, 31 May 2013 15:49:22 -0600 Subject: [PATCH] Call onReset event when Tween resets to beginning --- src/Tween.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Tween.js b/src/Tween.js index ce80724e..10736430 100644 --- a/src/Tween.js +++ b/src/Tween.js @@ -67,6 +67,9 @@ } this.reset(); + + // add Reset event handler after initial reset is fired + this.onReset = config.onReset; }; Kinetic.Tween.tweens = {}; @@ -127,6 +130,11 @@ that.onFinish(); } }; + tween.onReset = function() { + if (that._isLastTween(tween) && that.onReset) { + that.onReset(); + } + }; }, /** * play @@ -559,4 +567,4 @@ return c * t / d + b; } }; -})(); \ No newline at end of file +})();