Detect if sidebar breakpoint is reached

57 views
Skip to first unread message

Shareda

unread,
Oct 29, 2020, 3:47:00 PM10/29/20
to TiddlyWiki
Hello! I'm using JD's Mobile Layout. The sidebar does not hide when I click any navigate button, e.g. navigating to AdvancedSearch or my custom buttons.

I would like to use ActionSetFieldWidget inside of my buttons to hide the sidebar if the breakpoint is reached. How should I detect this condition?

JD's Mob uses Sidebar Breakpoint set at Control Panel and standard top bar buttons to show or hide the sidebar, so I think my question is about common tiddlywiki features.

TW Tones

unread,
Oct 29, 2020, 6:30:48 PM10/29/20
to TiddlyWiki
Shareda,

The trick is to find out how tiddlywiki already does it, and do similar.
  • See here https://tiddlywiki.com/#%24%3A%2FControlPanel
  • and $:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint which sets the break point
  • Then search for $:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint in the advanced search system and shadows tabs.
  • Then we find its in the $:/themes/tiddlywiki/vanilla/base which means its theme dependant
  • This is possible all in the Page Template and uses standard html/css but you could just use the value in $:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint if you want depending on what you are trying to achieve.
Tones

Shareda

unread,
Oct 30, 2020, 6:03:15 AM10/30/20
to TiddlyWiki
TW Tones, thank you! I've found out the same but I don't understand how i should get the page width, how I assign it to the variable available for tiddler wikitext.

пятница, 30 октября 2020 г. в 04:30:48 UTC+6, TW Tones:

TW Tones

unread,
Oct 30, 2020, 6:48:54 PM10/30/20
to TiddlyWiki
Shareda,

Sorry my notes did not help. A little more but not the answer I am sure.

$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint={{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}<br>
<$set name=sidebarbreakpoint value={{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}>
sidebarbreakpoint
=<<sidebarbreakpoint>>
</$set>

Tones
Reply all
Reply to author
Forward
0 new messages