Permalink
Browse files

Add layer.isAnimating

  • Loading branch information...
koenbok committed Dec 6, 2014
1 parent 24de214 commit 135a7295c8af4b79e8dcd954b92a0091494183c1
Showing with 15 additions and 0 deletions.
  1. +4 −0 framer/Layer.coffee
  2. +11 −0 test/tests/LayerAnimationTest.coffee
View
@@ -656,6 +656,10 @@ class exports.Layer extends BaseClass
return properties
@define "isAnimating",
exportable: false
get: -> @animations().length isnt 0
animateStop: ->
_.invoke(@animations(), "stop")
@@ -174,6 +174,17 @@ describe "LayerAnimation", ->
animation.on "end", test
animation.on "stop", test
it "should tell you if animations are running", ->
layer = new Layer()
animation = layer.animate
properties: {x: 100}
time: 0.5
layer.isAnimating.should.equal(true)
layer.animateStop()
layer.isAnimating.should.equal(false)
describe "Events", ->

0 comments on commit 135a729

Please sign in to comment.