From 04ea2dd07651553eba26e3cb3b7962b70facb575 Mon Sep 17 00:00:00 2001 From: pmario Date: Sun, 12 May 2024 18:13:54 +0200 Subject: [PATCH] add a tooltip and make caption the default fallback --- core/wiki/macros/toc.tid | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index d515bcbe1..f99d9523a 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -18,13 +18,17 @@ The very first toc macro is _not_ reused. So it can be used as a simple referenc \whitespace trim \procedure toc-defaultItemTemplate() - +] }}}> <$let tv-wikilinks="no"> <$transclude $tiddler={{{ [!is[blank]thenelse] }}} - $field={{{ [!is[blank]then[text]] :else[!is[blank]thenelse[caption]] }}} + $field={{{ [!is[blank]then[text]] + :else[!is[blank]then] }}} > - <$view field="title"/> + <$transclude $field={{{ [{!!caption}!is[blank]then[caption]else[title]] }}}> + <$view field="title"/> + + <$log/> \end @@ -190,14 +194,16 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i --> \procedure toc-item(isUnlinked:"") <% if [get[text]else[close]match[close]] %> - <$button actions=<> setTitle=<> setTo="open" class="tc-btn-invisible" tooltip=<>> + + <$button actions=<> setTitle=<> setTo="open" class="tc-btn-invisible"> <$transclude tiddler=<> /> <% if [match[yes]] %> <<_itemTemplate>> <% endif %> <% elseif [get[text]match[open]] %> - <$button actions=<> setTitle=<> setTo="close" class="tc-btn-invisible" tooltip=<>> + + <$button actions=<> setTitle=<> setTo="close" class="tc-btn-invisible"> <$transclude tiddler=<> /> <% if [match[yes]] %> <<_itemTemplate>> @@ -287,7 +293,7 @@ Shows an expandable toc. Item always have an open/close chevron <% if [subfilter] [subfilter] -[] -[subfilter] +[limit[1]] %> <> <% else %> - <$button class='tc-btn-invisible'> + <$button class='tc-btn-invisible' tabindex="-1"> {{$:/core/images/blank}} <% endif %>