diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-12-05 19:36:28 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-12-05 19:36:28 +0100 |
commit | 5161dfdb3a08490da0ae1c5c8b6515eb0ae0da30 (patch) | |
tree | 03217ab484a962ea4b183c1d9902ffe92d08a153 /src/animation/Timeline.js | |
parent | f089db0c1990d75bbd34713f97f547045ae92fca (diff) | |
download | svg.js-5161dfdb3a08490da0ae1c5c8b6515eb0ae0da30.tar.gz svg.js-5161dfdb3a08490da0ae1c5c8b6515eb0ae0da30.zip |
Release 3.0.33.0.3
Diffstat (limited to 'src/animation/Timeline.js')
-rw-r--r-- | src/animation/Timeline.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js index 44b5261..56198e0 100644 --- a/src/animation/Timeline.js +++ b/src/animation/Timeline.js @@ -45,9 +45,7 @@ export default class Timeline extends EventTarget { // schedules a runner on the timeline schedule (runner, delay, when) { if (runner == null) { - return this._runners.map(makeSchedule).sort(function (a, b) { - return a.runner.id - b.runner.id - }) + return this._order.map((id) => makeSchedule(this._runners[id])) } // The start time for the next animation can either be given explicitly, @@ -218,7 +216,7 @@ export default class Timeline extends EventTarget { if (dtToStart <= 0) { runnersLeft = true - // This is for the case that teh timeline was seeked so that the time + // This is for the case that the timeline was seeked so that the time // is now before the startTime of the runner. Thats why we need to set // the runner to position 0 runner.reset() @@ -281,9 +279,14 @@ export default class Timeline extends EventTarget { registerMethods({ Element: { - timeline: function () { - this._timeline = (this._timeline || new Timeline()) - return this._timeline + timeline: function (timeline) { + if (timeline == null) { + this._timeline = (this._timeline || new Timeline()) + return this._timeline + } else { + this._timeline = timeline + return this + } } } }) |