mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +00:00
parent
f4496d8fd3
commit
ea763d0eab
@ -1,7 +1,7 @@
|
||||
title: $:/core/macros/tabs
|
||||
tags: $:/tags/Macro
|
||||
|
||||
\define tabs(tabsList,default,state:"$:/state/tab",class,template,buttonTemplate)
|
||||
\define tabs(tabsList,default,state:"$:/state/tab",class,template,buttonTemplate,retain)
|
||||
<div class="tc-tab-set $class$">
|
||||
<div class="tc-tab-buttons $class$">
|
||||
<$list filter="$tabsList$" variable="currentTab"><$set name="save-currentTiddler" value=<<currentTiddler>>><$tiddler tiddler=<<currentTab>>><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
|
||||
@ -18,7 +18,7 @@ tags: $:/tags/Macro
|
||||
<div class="tc-tab-content $class$">
|
||||
<$list filter="$tabsList$" variable="currentTab">
|
||||
|
||||
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
|
||||
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$" retain="""$retain$""">
|
||||
|
||||
<$transclude tiddler="$template$" mode="block">
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
caption: tabs
|
||||
created: 20131228162203521
|
||||
modified: 20171113135543552
|
||||
modified: 20180408084453861
|
||||
tags: Macros [[Core Macros]]
|
||||
title: tabs Macro
|
||||
type: text/vnd.tiddlywiki
|
||||
@ -25,6 +25,8 @@ By default the tabs are arranged horizontally above the content. To get vertical
|
||||
: Optionally, the title of a tiddler to use as a [[template|TemplateTiddlers]] for transcluding the content of the selected tab
|
||||
;buttonTemplate
|
||||
: Optionally, the title of a tiddler to use as a [[template|TemplateTiddlers]] for transcluding the content of the button for the selected tab
|
||||
;retain
|
||||
: Optionally, "yes" specifies that the content of the tabs should be retained when switching to another tab, avoiding re-rendering it (this can be useful to avoid video or audio sources unexpectedly resetting)
|
||||
|
||||
Within the template, the title of the selected tab is available in the <<.var currentTab>> variable.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user