mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-08 19:09:57 +00:00
63243c5855
This is a hacky way of having macro definitions that behave as if they are global to the wiki. The new tabs macro itself is cool, though: neatly encapsulates most of the gubbins around a tab control, and the rendering is quite easy to style.
18 lines
672 B
Plaintext
18 lines
672 B
Plaintext
title: $:/core/ui/PageMacros
|
|
|
|
\define tabs(tabsList,default,state:"$:/currentTab")
|
|
<div class="tw-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tw-tab-selected"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/> </$button>
|
|
</$list>
|
|
</div>
|
|
<div class="tw-tab-divider">
|
|
</div>
|
|
<div class="tw-tab-content">
|
|
<$list filter="$tabsList$" variable="currentTab">
|
|
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
|
|
<$transclude tiddler=<<currentTab>>/>
|
|
</$reveal>
|
|
</$list>
|
|
</div>
|
|
\end
|
|
{{$:/core/ui/PageTemplate}}
|