Permalink
Browse files

Adding pending animations to the context

  • Loading branch information...
nvh committed Oct 7, 2016
1 parent 705546c commit a9e75d41e5348cf7b30014f4d08c39a6479a916b
Showing with 11 additions and 2 deletions.
  1. +1 −2 framer/Animation.coffee
  2. +10 −0 test/tests/LayerAnimationTest.coffee
View
@@ -176,6 +176,7 @@ class exports.Animation extends BaseClass
else
start = @_start
+ @layer.context.addAnimation(@)
# If we have a delay, we wait a bit for it to start
if @options.delay
@_delayTimer = Utils.delay(@options.delay, start)
@@ -185,7 +186,6 @@ class exports.Animation extends BaseClass
return true
stop: (emit=true) ->
-
if @_delayTimer?
Framer.CurrentContext.removeTimer(@_delayTimer)
@_delayTimer = null
@@ -241,7 +241,6 @@ class exports.Animation extends BaseClass
return not @isNoop
_start: =>
- @layer.context.addAnimation(@)
@_delayTimer = null
@emit(Events.AnimationStart)
Framer.Loop.on("update", @_update)
@@ -417,6 +417,16 @@ describe "LayerAnimation", ->
Utils.delay 0.3, ->
a.isPending.should.equal false
done()
+
+ it "should add pending animations to the context", ->
+ layer = new Layer
+ a = layer.animate
+ x: 100
+ options:
+ delay: 0.3
+ (a in layer.context.animations).should.equal true
+
+
describe "Repeat", ->
it "should start repeatedly", (done) ->

0 comments on commit a9e75d4

Please sign in to comment.