vUX / TimeLineList / v4.1.0
Give a plain <ul> a class and a few data attributes. TimeLineList draws
the rail, the markers and the labels, and stacks them when the window gets narrow.
TouchHandler, the animator, delegated event handling.SPAEngine, DataView and the Component module.
Each box is one of the attributes a list carries, mapped through config.dataAttributes.
Styles are read once, when a list is built, so editing one rebuilds the list:
destroy(), then a fresh instance and autoBuild(). The small-view threshold is
different: it is re-read on every window resize, so the slider just changes the attribute.
These three lists share a class and a single TimeLineList. Each one's attributes become rules
scoped to that list alone, so nothing leaks between them. The markers are plain CSS: a
content character, a ring, a dashed rail.
✓ markersdashed railhollow rings
smallView compares against the window width, not the list's. Cards this narrow never
have room for a label column, so these lists set data-small="99999" and always use the
stacked layout.
autoBuild() only sees the lists on the page when it runs. A list inserted afterwards renders as
a plain bullet list until refresh() picks it up, optionally scoped to a parent element.
New entries in a list that is already built need nothing: the styling is class-based.
1. Insert a list: it shows up unstyled.
2. Call refresh(feed): it becomes a timeline, with its own marker colour.
3. Add an entry to the first list: no refresh needed.
The config setters and the methods validate on the spot and throw a message naming what is
wrong. These buttons do the wrong thing on purpose.