Permalink
Browse files

Added Animation.isNoop

  • Loading branch information...
nvh committed Oct 3, 2016
1 parent c8f66f3 commit 32000eb22a8740928cb67c67434e501139c6fa60
Showing with 17 additions and 1 deletion.
  1. +4 −1 framer/Animation.coffee
  2. +13 −0 test/tests/LayerAnimationTest.coffee
View
@@ -107,6 +107,8 @@ class exports.Animation extends BaseClass
if @options?.looping and @layer? and !@isAnimating
@restart()
@define "isNoop", @simpleProperty("isNoop", false)
start: =>
@_animator = @_createAnimator()
@@ -238,10 +240,11 @@ class exports.Animation extends BaseClass
@emit(Events.AnimationEnd)
_noop: =>
@isNoop = true
@emit(Events.AnimationStart)
@emit(Events.AnimationStop)
@emit(Events.AnimationEnd)
return false
return not @isNoop
_start: =>
@layer.context.addAnimation(@)
@@ -233,6 +233,19 @@ describe "LayerAnimation", ->
a.start()
animation.start()
it "it should set the noop property", ->
layer = new Layer
animation = layer.animate
x: 50
animation.isNoop.should.be.equal false
animation.finish()
layer.x.should.be.equal 50
animation2 = layer.animate
x: 50
animation2.isNoop.should.be.equal true
describe "Context", ->
it "should list running animations", ->

0 comments on commit 32000eb

Please sign in to comment.