vUX / TimeLineList / v4.1.0

Any list, drawn as a timeline.

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.

tl.config.className = "history"; tl.autoBuild(); // that's all
  • The component setForm validator, modal displayer, date picker and tool tips.
  • Touch and motionTouchHandler, the animator, delegated event handling.
  • Apps, not pagesSPAEngine, DataView and the Component module.
  • Every module verifiedEach one driven in a browser, fixed, documented and given a page like this.

01Playground

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.

List attributes
built
window-
layout-
instance#1
built
Equivalent code

                

03Lists that arrive later

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.

#feed1 list · 1 built
  • Present at autoBuild()Built straight away.

Try it in order

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.

04Bad input fails immediately

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.

No error yet: press one of the buttons above.