1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-04 23:39:57 +00:00

toc - do not show "more" chevron, it all child nodes are hidden

This commit is contained in:
pmario 2024-02-14 13:39:36 +01:00
parent 781213911d
commit 780cf038ab

View File

@ -127,14 +127,15 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i
<!-- --> <!-- -->
<!-- Helper functions for toc-openBranch and toc-closeBranch procedures --> <!-- Helper functions for toc-openBranch and toc-closeBranch procedures -->
\procedure toc-tagLikeChildFilter() [<currentTiddler>get<tagField>enlist-input[]] \procedure toc-tagLikeChildFilter() [<currentTiddler>get<tagField>enlist-input[]] -[toc-hide[yes]]
\procedure toc-parentChildFilter() [has<parentField>] :filter[get<parentField>match<..currentTiddler>] \procedure toc-parentChildFilter() [has<parentField>] :filter[get<parentField>match<..currentTiddler>] -[toc-hide[yes]]
\procedure toc-tagChildFilter() [tag<currentTiddler>] \procedure toc-tagChildFilter() [tag<currentTiddler>] -[toc-hide[yes]]
<!-- this function uses the variables NOT the tiddler fields --> <!-- this function uses the variables NOT the tiddler fields -->
\function tf.toc-hasChildren() \function tf.toc-hasChildren()
[<tagField>!is[blank]then<toc-tagLikeChildFilter>] [<tagField>!is[blank]then<toc-tagLikeChildFilter>]
:else[<parentField>!is[blank]then<toc-parentChildFilter>else<toc-tagChildFilter>] :else[<parentField>!is[blank]then<toc-parentChildFilter>]
:else[<toc-tagChildFilter>]
\end \end
\function tf.toc-stateTitle() [[$:/state/toc]] [<path>] "/" [<currentTiddler>] +[join[]] \function tf.toc-stateTitle() [[$:/state/toc]] [<path>] "/" [<currentTiddler>] +[join[]]
@ -283,6 +284,14 @@ Shows an expandable toc. Item always have an open/close chevron
<!-- v5.1.23 use target-field if present in tiddler --> <!-- v5.1.23 use target-field if present in tiddler -->
<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}> <$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}>
<!-- The subfilter<exclude> needs to be the last filter run --> <!-- The subfilter<exclude> needs to be the last filter run -->
<$log
ct=<<currentTiddler>>
tf.toc-hasChildren=<<tf.toc-hasChildren>>
tf.toc-hasChildren-f= {{{ [subfilter<tf.toc-hasChildren>]
exclude=<<exclude>> }}}
filter={{{ [subfilter<tf.toc-hasChildren>] [subfilter<tf.toc-curTidInclude>] -[<currentTiddler>] -[subfilter<exclude>] }}}
/>
<!-- -->
<% if [subfilter<tf.toc-hasChildren>] [subfilter<tf.toc-curTidInclude>] -[<currentTiddler>] -[subfilter<exclude>] +[limit[1]] %> <% if [subfilter<tf.toc-hasChildren>] [subfilter<tf.toc-curTidInclude>] -[<currentTiddler>] -[subfilter<exclude>] +[limit[1]] %>
<<toc-item>> <<toc-item>>
<% else %> <% else %>