Skip to content
Permalink
Browse files

Fixed setting ignoreEvents by state on layer

  • Loading branch information
nvh committed Sep 12, 2016
1 parent f777e28 commit 9e65920b333a556aca8189163fc9e472a6abf868
Showing with 20 additions and 1 deletion.
  1. +2 −1 framer/LayerStates.coffee
  2. +18 −0 test/tests/LayerStatesTest.coffee
@@ -28,7 +28,8 @@ class exports.LayerStates

# TODO: Maybe we want to support advanced data structures like objects in the future too.
for k, v of properties

if k in LayerStatesIgnoredKeys
continue
if Color.isValidColorProperty(k, v)
stateProperties[k] = new Color(v)
continue
@@ -183,6 +183,24 @@ describe "LayerStates", ->
layer.on Events.AnimationEnd, ready
layer.animateToNextState()

it "ignoreEvents should not be part of the initial state", ->

layer = new Layer

layer.states.stateA =
backgroundColor: "rgba(255,0,255,1)"

layer.onClick ->
layer.animateToNextState()

layer.x.should.equal 0

layer.animateToNextState(instant: true)
layer.animateToNextState(instant: true)
layer.animateToNextState(instant: true)
layer.ignoreEvents.should.equal false


it "should set scroll property", ->

layer = new Layer

0 comments on commit 9e65920

Please sign in to comment.
You can’t perform that action at this time.