Hi Simon I think the way to do this is as a startup module that listens for viewport size changes and then updates a couple of state tiddlers with the values. The changes to those tiddlers would then trigger any necessary rerendering via the refresh process.
The new DynaView plugin already listens for scroll and resize events, and so it might be reasonable to extend it with these features: https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/dynaview/dynaview.js <https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/dynaview/dynaview.js> Best wishes Jeremy > On 16 Feb 2018, at 10:59, Simon Huber <[email protected]> wrote: > > > > Am Freitag, 16. Februar 2018 11:29:38 UTC+1 schrieb PMario: > Hi, > > On Friday, February 16, 2018 at 10:21:26 AM UTC+1, Simon Huber wrote: > I'd like to propose adding a macro to the TW core functionality that returns > the viewport dimensions > The use-cases can be many > > Could you name some? > > executing, revealing, listing different things if the viewport width/height > is lower than x, something else if higher > one can do things in css with vw of media queries, but inside macros or > widgets I couldn't find a way to get the viewport dimensions > > I'm a little bit concerned, that a macro won't be always updated. ... Since > they are only calculated, if rendered. ... But I may be wrong here, without > tests. > > no you're right! it doesn't update. Should I go the widget way? > > -m > > thanks Mario! > > Simon > > -- > You received this message because you are subscribed to the Google Groups > "TiddlyWikiDev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/tiddlywikidev > <https://groups.google.com/group/tiddlywikidev>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywikidev/e751f885-5861-476c-9ae6-358a6ab1ecaf%40googlegroups.com > > <https://groups.google.com/d/msgid/tiddlywikidev/e751f885-5861-476c-9ae6-358a6ab1ecaf%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/1926CA60-69F2-4660-A8FB-5D595EED8968%40gmail.com. For more options, visit https://groups.google.com/d/optout.
