Permalink
Browse files

Add `switchTo` shorthand for `instant: true`

  • Loading branch information...
nvh committed Jul 26, 2016
1 parent 7b96385 commit 3d868d006ff60876132d537cefcf92339b875293
Showing with 5 additions and 2 deletions.
  1. +4 −0 framer/Layer.coffee
  2. +1 −2 test/tests/LayerStatesTest.coffee
View
@@ -935,6 +935,10 @@ class exports.Layer extends BaseClass
animationFinished()
animation
switchTo: (properties,options={}) ->
options = _.defaults({instant:true},options)
@animateTo(properties,options)
animateToNext: (stateNames=[],options) ->
if not Array.isArray(stateNames)
if not options? and typeof stateNames is 'object'
@@ -70,8 +70,7 @@ describe "LayerStates", ->
options:
instant: true
layer.animateTo "stateA",
instant: true
layer.switchTo "stateA"
layer.states.currentName.should.equal "stateA"
layer.x.should.equal 123

0 comments on commit 3d868d0

Please sign in to comment.