Skip to content
Permalink
Browse files

Add animateToNext

  • Loading branch information
nvh committed Jul 26, 2016
1 parent 358a3f5 commit 2922fd86ea7a9864f6f2c6b44264d7b1700d2288
Showing with 11 additions and 1 deletion.
  1. +11 −1 framer/Layer.coffee
@@ -934,8 +934,18 @@ class exports.Layer extends BaseClass
animationFinished()
animation

animations: ->
animateToNext: (stateNames=[],options) ->
if not Array.isArray(stateNames)
if not options? and typeof stateNames is 'object'
options = stateNames
stateNames = []
else
stateNames = Utils.arrayFromArguments arguments
options = {}
nextState = @_stateMachine.next(stateNames)
@animateTo nextState, options

animations: ->
# Current running animations on this layer
_.filter @_context.animations, (animation) =>
animation.options.layer is @

0 comments on commit 2922fd8

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