almende/chap-links-library — pull request #78 by gagabla (2013-02-15 18:31:56+00:00)
Title: Allow extension of links.Timeline using inheritation

Currently the constructor of the links.Timeline class requires a DOM element as container, and will raise a runtime-error, when no suitable object is handed in.

To be able to inherit from the links.Timeline class, one needs to call its constructor once only for this purpose, and without container of course. Therefore the constructor should return without container element immediately, so that no harm is done, but inheritation chain is build up.

Inheritation can then be realized using something like this:

MyCustomTimelineClass.prototype = new links.Timeline(null);

Another small fix was done in the stackMoveToFinal method, that now iterates over the finalItems-Array, as most other methods do, so that the finalItems-Array can be a subset of the currentItems-Array.