]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Call onAnimationComplete when reached last frame
authormattclegg <cleggmatt@gmail.com>
Tue, 30 Jun 2015 10:13:30 +0000 (11:13 +0100)
committermattclegg <cleggmatt@gmail.com>
Tue, 30 Jun 2015 10:13:30 +0000 (11:13 +0100)
src/Chart.Core.js

index d0a70336d9c34091eae07f4188a3f5f41ddfa0a4..70cbd6d8a2d00920c10ad7fb12ceb5614e897299 100755 (executable)
                                
                                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--;