Skip to content

Commit

Permalink
Still support the old animate syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh committed Sep 15, 2016
1 parent d5a82c2 commit ed0057e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions framer/Layer.coffee
Expand Up @@ -885,12 +885,6 @@ class exports.Layer extends BaseClass
##############################################################
## ANIMATION

animate: (options) ->
# console.warn "Layer.animate is deprecated: please use Layer.animateTo instead"
properties = options.properties
delete options.properties
@animateTo(properties, options)

animateToState: (stateName, options={}) ->
properties = @_stateMachine.switchTo stateName
if @_stateMachine.previousName is @_stateMachine.currentName
Expand All @@ -911,6 +905,14 @@ class exports.Layer extends BaseClass
if typeof properties == 'string'
stateName = properties
return @animateToState stateName, options

#Support the old properties syntax
if properties.properties?
# console.warn "Using Layer.animate with 'properties' key is deprecated: please use 'options' key to provide animation options instead"
options = properties
properties = options.properties
delete options.properties

_.defaults(options,properties.options,@options)
delete properties.options

Expand Down

0 comments on commit ed0057e

Please sign in to comment.