diff options
author | Rémi Tétreault <tetreault.remi@gmail.com> | 2017-03-05 20:55:09 -0500 |
---|---|---|
committer | Rémi Tétreault <tetreault.remi@gmail.com> | 2017-03-07 20:44:58 -0500 |
commit | 9165ee80eca0be42970ccbc5470f5541f206f7f3 (patch) | |
tree | 5edc0e305ce082ab91b1bffa0d78ae7047a2be21 /dist/svg.js | |
parent | 927aeaeafa4e3bf21390b86f1a5087b49558db49 (diff) | |
download | svg.js-9165ee80eca0be42970ccbc5470f5541f206f7f3.tar.gz svg.js-9165ee80eca0be42970ccbc5470f5541f206f7f3.zip |
Make the method dequeue stop the current animation
There was a bug in the dequeue method of the FX module. It was not stopping
the current animation as it was supposed too. This bug is now fixed. Also,
I rewritten the test that @fuzzyma left commented. I changed its
implementation to not use the once callback since there seem to be some issues
when combining once and dequeue. The method stop was also modified, it now
call start only when it's revelant.
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/dist/svg.js b/dist/svg.js index 42df319..361019a 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens <wout@mick-wout.com> * @license MIT * -* BUILT: Mon Mar 06 2017 18:48:59 GMT+0100 (Mitteleuropäische Zeit) +* BUILT: Tue Mar 07 2017 20:44:26 GMT-0500 (EST) */; (function(root, factory) { if (typeof define === 'function' && define.amd) { @@ -1472,14 +1472,14 @@ SVG.FX = SVG.invent({ */ , dequeue: function(){ // stop current animation - this.situation && this.situation.stop && this.situation.stop() + this.stop() // get next animation from queue this.situation = this.situations.shift() if(this.situation){ if(this.situation instanceof SVG.Situation) { - this.startCurrent() + this.start() } else { // If it is not a SVG.Situation, then it is a function, we execute it this.situation.call(this) @@ -1535,15 +1535,16 @@ SVG.FX = SVG.invent({ * @return this */ , stop: function(jumpToEnd, clearQueue){ - if(!this.active) this.start() + var active = this.active + this.active = false if(clearQueue){ this.clearQueue() } - this.active = false - if(jumpToEnd && this.situation){ + // initialize the situation if it was not + !active && this.startCurrent() this.atEnd() } |