TW Tones, yes, maybe I can do so, but.. I made this variable to get the desired value from inside of my custumized link.js widget, which redraws all internal links. The $:/hb/HighlightIntensityKW value can be changed only by RangeWidget from UI, that's what I need. It works as i need except of loosing current scroll position.
Eric, can I get value of such <<hb-highlight-intensity-kw>> macro inside of my customized link.js by some JavaScript expression? If so, wouldn't that make it slower (compared to using a variable)? Now i have *10 109 * linked tiddlers, and soon there will be ~ 25 000. Now I get value by this JS line: var highlightGain = Number(this.getVariable("hb-highlight-intensity-kw")); воскресенье, 11 октября 2020 г. в 07:46:31 UTC+6, Eric Shulman: > 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/83595c07-e43e-4182-8677-6cefa3b43028n%40googlegroups.com.