From: mattclegg Date: Tue, 30 Jun 2015 10:13:30 +0000 (+0100) Subject: Call onAnimationComplete when reached last frame X-Git-Tag: v1.1.0~35^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7e39620870787c4a49ee4c0085a46171d5f57b6;p=thirdparty%2FChart.js.git Call onAnimationComplete when reached last frame --- diff --git a/src/Chart.Core.js b/src/Chart.Core.js index d0a70336d..70cbd6d8a 100755 --- a/src/Chart.Core.js +++ b/src/Chart.Core.js @@ -2141,8 +2141,11 @@ this.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject); + // Check if executed the last frame. if (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps){ - // executed the last frame. Remove the animation. + // Call onAnimationComplete + this.animations[i].animationObject.onAnimationComplete.call(this.animations[i].chartInstance); + // Remove the animation. this.animations.splice(i, 1); // Keep the index in place to offset the splice i--;