quick change to timeline handler for better CSS customization?

2 views
Skip to first unread message

erin

unread,
Jan 5, 2010, 7:00:55 PM1/5/10
to TiddlyWikiDev
If you add a single line to the config.macros.timeline.handler, skins
should be able to change how the timeline looks in the sidebar vs. in
the main content:

if(theDay != lastDay) {
var ul = document.createElement("ul");
ul.setAttribute("class", "timeline");
place.appendChild(ul);

The ul.setAttribute adds a class attribute to the unordered list
containing the elements of the timeline: CSS can then change the text
attributes for the elements based on the context in which the list is
displayed...

Can that be included?

FND

unread,
Jan 6, 2010, 5:19:35 AM1/6/10
to tiddly...@googlegroups.com
> If you add a single line to the config.macros.timeline.handler, skins
> should be able to change how the timeline looks in the sidebar vs. in
> the main content

Seems like a reasonable suggestion, and is in line with previous
changes. Ticketed and committed:
http://trac.tiddlywiki.org/ticket/1202

Thanks!


-- F.

Eric Shulman

unread,
Jan 6, 2010, 7:05:32 AM1/6/10
to TiddlyWikiDev
> If you add a single line to the config.macros.timeline.handler, skins
> should be able to change how the timeline looks in the sidebar vs. in
> the main content:
>
>                 if(theDay != lastDay) {
>                         var ul = document.createElement("ul");
>                         ul.setAttribute("class", "timeline");
>                         place.appendChild(ul);

You can do this without any core code changes, simply by using a CSS
class wrapper around the macro.

For example, in SideBarTabs, write:
{{timeline{<<timeline>>}}}

Then, in StyleSheet, write:
.timeline ul { ... }

enjoy,
-e


Reply all
Reply to author
Forward
0 new messages