Permalink
Browse files

Improving isAnimating by using layer.animations()

  • Loading branch information...
nvh committed Oct 7, 2016
1 parent 35513f1 commit 4af7e9a33bebf1b606b953262c490053596d5e56
Showing with 13 additions and 1 deletion.
  1. +1 −1 framer/Animation.coffee
  2. +12 −0 test/tests/LayerAnimationTest.coffee
View
@@ -85,7 +85,7 @@ class exports.Animation extends BaseClass
@define "isPending", get: -> @_delayTimer?
@define "isAnimating",
- get: -> @ in @layer.context.animations
+ get: -> @ in @layer.animations()
@define "looping",
get: -> @options.looping
@@ -332,6 +332,18 @@ describe "LayerAnimation", ->
layer.animateStop()
layer.isAnimating.should.equal(false)
+ it "should tell you if delayed animations are running", (done) ->
+ layer = new Layer()
+ animation = layer.animate
+ x: 100
+ options:
+ time: 0.3
+ delay: 0.1
+ animation.isAnimating.should.equal(false)
+ Utils.delay 0.2, ->
+ animation.isAnimating.should.equal(true)
+ done()
+
describe "Events", ->

0 comments on commit 4af7e9a

Please sign in to comment.