On Saturday, October 10, 2020 at 9:39:43 AM UTC-7, Shareda wrote:
>
> How i can avoid page refresh when I change the 'global' variable? I need
> redraw, but i don't want to loose page's scroll position. Now this variable
> is declared inside of $:/core/ui/PageTemplate and linked to some config
> tiddler:
>
> <$set name="hb-highlight-intensity-kw" value={{$:/hb/HighlightIntensityKW}}>
> Is there any better place for my 'global' variable?
>
If your "global variable" is only needed when *viewing* tiddlers in the
Story River, or when *previewing* while editing a tiddler, but *not* in the
Sidebar, SiteTitle, etc., you can do this:
1) In $:/hb/HighlightIntensityKW, instead of just containing the value
(e.g., "12345"), use \define, like this:
\define hb-highlight-intensity-kw() 12345
2) Tag $:/hb/HighlightIntensityKW with "$:/tags/Macro/View"
Then, you can use <<hb-highlight-intensity-kw>> in tiddler content or as a
widget parameter value and it will be replaced by 12345 as before, but
without causing the entire PageTemplate to be re-rendered. Thus, the Story
River's current scroll position will not be lost.
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/60bc42e7-89fd-498a-a74a-513a65e36a4co%40googlegroups.com.