Skip to content

Commit a876193

Browse files
committed
Replace details/summary with reveal widget
1 parent d1d20d7 commit a876193

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
caption: Supp Notes Content
22
created: 20251107151758434
3-
modified: 20251115173911160
3+
modified: 20251117043731647
44
tags: $:/tags/SupplementaryInfo
55
title: $:/supp-info/notes/content
66
type: application/json

tiddlers/$__supp-info_notes_styles_main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
margin-left: 1em;
99
svg {width: 1em; height: 1em; vertical-align: middle;}
1010
}
11-
summary {background-color: #996; color: white; padding: .5em; font-weight: bold;}
11+
summary, .summary, .summary button.toggle {background-color: #996; color: white; padding: .5em; font-weight: bold;}
1212
.note-row {
1313
display: flex;
1414
flex-direction: row;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
caption: Supp Notes Stylesheet
22
created: 20251115161726500
3-
modified: 20251115172622254
3+
modified: 20251117041637033
44
tags: $:/tags/Stylesheet
55
title: $:/supp-info/notes/styles/main
66
type: text/css

tiddlers/$__supp-info_notes_view-template.tid

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
caption: Supp Notes Template
22
created: 20251107152410791
3-
modified: 20251115172707650
3+
modified: 20251117044242134
44
query: [prefix[$:/supp-info]]
55
tags: $:/tags/ViewTemplate
66
title: $:/supp-info/notes/view-template
@@ -12,6 +12,8 @@ type: text/vnd.tiddlywiki
1212
$tiddler="$:/supp-info/notes/content"
1313
$value={{{ [{$:/supp-info/notes/content}jsonset<currentTiddler>,<count>,[Dummy text]format:json[2]] }}}
1414
/>
15+
<$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$` $field="state" $value="show" />
16+
<$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(index)$` $field="mode" $value="edit" />
1517
</$let>
1618
\end add-note
1719

@@ -46,13 +48,17 @@ type: text/vnd.tiddlywiki
4648
<div class="supp-notes">
4749
<$let count={{{ [{$:/supp-info/notes/content}jsonindexes<currentTiddler>last[]add[1]] }}}>
4850

49-
<details open>
50-
<summary>
51-
<<count>> Note(s)
52-
<span class="controls">
53-
<$button actions="<<add-note>>" ><span class="icon">{{$:/core/images/new-button}}</span></$button>
54-
</span>
55-
</summary>
51+
52+
<div class="summary">
53+
<$button class="tc-btn-invisible toggle" set=`$:/temp/supp-info/notes/$(currentTiddler)$!!state` setTo={{{ [<currentTiddler>addprefix[$:/temp/supp-info/notes/]get[state]toggle[show],[]] }}}>
54+
<$let arrow={{{ [<currentTiddler>addprefix[$:/temp/supp-info/notes/]get[state]match[show]then[▽]else[▷]] }}}><<arrow>></$let>
55+
<<count>> Note<% if [<count>!match[1]] %>s<% endif %>
56+
</$button>
57+
<span class="controls">
58+
<$button actions="<<add-note>>" ><span class="icon">{{$:/core/images/new-button}}</span></$button>
59+
</span>
60+
</div>
61+
<$reveal state=`$:/temp/supp-info/notes/$(currentTiddler)$!!state` type="match" text="show" tag=div>
5662
<div class="note-list">
5763
<$list filter="[{$:/supp-info/notes/content}jsonindexes<currentTiddler>]" variable="index">
5864
<div class="note-row">
@@ -76,7 +82,7 @@ type: text/vnd.tiddlywiki
7682
</div>
7783
</$list>
7884
</div>
79-
</details>
85+
</$reveal>
8086

8187
</$let>
8288
</div>

0 commit comments

Comments
 (0)