mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-24 18:21:43 +00:00
Add fold tiddler toolbar button
Addressing this tweet: https://twitter.com/s_stryjecki/status/629349768280604672
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
title: $:/core/ui/Buttons/fold
|
||||
tags: $:/tags/ViewToolbar
|
||||
caption: {{$:/core/images/fold-button}} {{$:/language/Buttons/Fold/Caption}}
|
||||
description: {{$:/language/Buttons/Fold/Hint}}
|
||||
|
||||
\define folded-state()
|
||||
$:/state/folded/$(currentTiddler)$
|
||||
\end
|
||||
|
||||
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
|
||||
<$reveal type="nomatch" state=<<folded-state>> text="hide" default="show">
|
||||
{{$:/core/images/fold-button}}
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<folded-state>> text="hide" default="show">
|
||||
{{$:/core/images/unfold-button}}
|
||||
</$reveal>
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Fold/Caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
||||
Reference in New Issue
Block a user