From efc383d4dc005046a76da4134cd25e8aa11b8042 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Tue, 20 Nov 2018 17:40:17 +0100 Subject: add register for insertBefore and insertAfter --- src/animation/Timeline.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/animation') diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js index 6abcb80..6e1ed8d 100644 --- a/src/animation/Timeline.js +++ b/src/animation/Timeline.js @@ -38,16 +38,11 @@ export default class Timeline extends EventTarget { this._lastStepTime = 0 } - /** - * - */ - // schedules a runner on the timeline schedule (runner, delay, when) { - // FIXME: how to sort? maybe by runner id? if (runner == null) { return this._runners.map(makeSchedule).sort(function (a, b) { - return (a.start - b.start) || (a.duration - b.duration) + return a.runner.id - b.runner.id }) } @@ -189,7 +184,7 @@ export default class Timeline extends EventTarget { // Update the time this._time += dtTime this._lastStepTime = this._time - // this.fire('time', this._time) + this.fire('time', this._time) // Run all of the runners directly var runnersLeft = false @@ -238,6 +233,7 @@ export default class Timeline extends EventTarget { if (runnersLeft) { this._nextFrame = Animator.frame(this._step.bind(this)) } else { + this.fire('finished') this._nextFrame = null } return this -- cgit v1.2.3