summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/Timeline.js10
-rw-r--r--src/modules/optional/arrange.js13
2 files changed, 15 insertions, 8 deletions
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
diff --git a/src/modules/optional/arrange.js b/src/modules/optional/arrange.js
index 6ce2eea..f06509a 100644
--- a/src/modules/optional/arrange.js
+++ b/src/modules/optional/arrange.js
@@ -107,5 +107,16 @@ export function insertAfter (element) {
}
registerMethods('Dom', {
- siblings, position, next, prev, forward, backward, front, back, before, after
+ siblings,
+ position,
+ next,
+ prev,
+ forward,
+ backward,
+ front,
+ back,
+ before,
+ after,
+ insertBefore,
+ insertAfter
})