Detect if sidebar breakpoint is reached

57 visualizzazioni
Passa al primo messaggio da leggere

Shareda

da leggere,
29 ott 2020, 15:47:0029/10/20
a 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

da leggere,
29 ott 2020, 18:30:4829/10/20
a 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

da leggere,
30 ott 2020, 06:03:1530/10/20
a 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

da leggere,
30 ott 2020, 18:48:5430/10/20
a 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
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi