Skip to content
Browse files

Add Fx.isPaused() method

  • Loading branch information...
1 parent d0e5708 commit 56a009f682e1b593bbed84ad4309bf793e827c55 @thatmarvin thatmarvin committed with Dec 3, 2011
Showing with 20 additions and 1 deletion.
  1. +15 −0 Docs/Fx/Fx.md
  2. +5 −1 Source/Fx/Fx.js
View
15 Docs/Fx/Fx.md
@@ -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
View
6 Source/Fx/Fx.js
@@ -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 56a009f

Please sign in to comment.
Something went wrong with that request. Please try again.