Skip to content

Commit

Permalink
Add Fx.isPaused() method
Browse files Browse the repository at this point in the history
thatmarvin authored and arian committed Sep 1, 2012
1 parent 9836728 commit ee08222
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Docs/Fx/Fx.md
Original file line number Diff line number Diff line change
@@ -182,6 +182,21 @@ Returns true if the animation is running.



Fx Method: isPaused {#Fx:isPaused}
------------------------------------

Returns true if the animation is paused. You can use this to check if you need to call [Fx:resume](#Fx:resume) to resume an animation instead of restarting it.

### Syntax:

var isPaused = myFx.isPaused();

### Returns:

* (*boolean*) - If the animation is paused, returns true. Otherwise, returns false.



[Fx]: #Fx
[Fx.Transitions]: /core/Fx/Fx.Transitions
[Fx.Transitions:sine]: /core/Fx/Fx.Transitions#Fx-Transitions:sine
6 changes: 5 additions & 1 deletion Source/Fx/Fx.js
Original file line number Diff line number Diff line change
@@ -130,13 +130,17 @@ var Fx = this.Fx = new Class({
},

resume: function(){
if ((this.frame < this.frames) && !this.isRunning()) pushInstance.call(this, this.options.fps);
if (this.isPaused()) pushInstance.call(this, this.options.fps);
return this;
},

isRunning: function(){
var list = instances[this.options.fps];
return list && list.contains(this);
},

isPaused: function(){
return (this.frame < this.frames) && !this.isRunning();
}

});

0 comments on commit ee08222

Please sign in to comment.