inherit: SVG.EventTarget,
// Construct a new timeline on the given element
- create: function (element) {
-
- // Store a reference to the element to call its parent methods
- this._element = element || null
+ create: function () {
this._timeSource = function () {
return time.now()
}
return this._dispatcher
},
- // FIXME: there is no need anymore to save the element on the timeline
- element (element) {
- if(element == null) return this._element
- this._element = element
- },
-
/**
*
*/
})
}
+ if (!this.active()) {
+ this._step()
+ if (when == null) {
+ when = 'now'
+ }
+ }
+
// The start time for the next animation can either be given explicitly,
// derived from the current timeline time or it can be relative to the
// last start time to chain animations direclty
if (!this._nextFrame)
this._nextFrame = SVG.Animator.frame(this._step.bind(this))
return this
+ },
+
+ active () {
+ return !!this._nextFrame
}
},
parent: SVG.Element,
construct: {
timeline: function () {
- this._timeline = (this._timeline || new SVG.Timeline(this))
+ this._timeline = (this._timeline || new SVG.Timeline())
return this._timeline
},
}