Permalink
Browse files

Add isPending flag

  • Loading branch information...
nvh committed Oct 7, 2016
1 parent 24d1b38 commit 705546cbb338e46bac81a1875de70cabacb83de0
Showing with 20 additions and 0 deletions.
  1. +3 −0 framer/Animation.coffee
  2. +17 −0 test/tests/LayerAnimationTest.coffee
View
@@ -82,6 +82,8 @@ class exports.Animation extends BaseClass
@define "layer",
get: -> @_layer
@define "isPending", get: -> @_delayTimer?
@define "isAnimating",
get: -> @ in @layer.context.animations
@@ -240,6 +242,7 @@ class exports.Animation extends BaseClass
_start: =>
@layer.context.addAnimation(@)
@_delayTimer = null
@emit(Events.AnimationStart)
Framer.Loop.on("update", @_update)
@@ -400,6 +400,23 @@ describe "LayerAnimation", ->
layer.x.should.equal 0
done()
it "pending flag should be false by default", ->
layer = new Layer
a = layer.animate
x: 100
a.isPending.should.equal false
a.stop()
it "should add a pending flag for delayed animations", (done) ->
layer = new Layer
a = layer.animate
x: 100
options:
delay: 0.3
a.isPending.should.equal true
Utils.delay 0.3, ->
a.isPending.should.equal false
done()
describe "Repeat", ->
it "should start repeatedly", (done) ->

0 comments on commit 705546c

Please sign in to comment.