1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 20:10:03 +00:00
TiddlyWiki5/editions/dynaviewdemo/tiddlers/ViewTemplate.tid
Jermolene 8defe41458 Dynaview demo: Avoid hiding tiddlers that scroll out of view
We were getting some problems on Firefox/Safari whereby tiddlers would flicker between visible and invisible, spinning up my laptop fan.
2019-01-29 11:38:25 +00:00

29 lines
1.4 KiB
Plaintext

title: $:/core/ui/ViewTemplate
\whitespace trim
\define frame-classes()
tc-tiddler-frame tc-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ $(tiddlerTagClasses)$ $(userClass)$
\end
\define folded-state()
$:/state/folded/$(currentTiddler)$
\end
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">> userClass={{!!class}}>
<$tiddler tiddler=<<currentTiddler>>>
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class=<<frame-classes>>>
<$set name="state" value={{{ [[$:/state/viewtemplate/visibility/]addsuffix<currentTiddler>] }}}>
<$reveal stateTitle=<<state>> type="match" text="true" tag="div">
<div class="tc-dynaview-set-tiddler-when-visible tc-dynaview-expand-viewport" data-dynaview-set-tiddler=<<state>> data-dynaview-set-value="true" data-dynaview-has-triggered={{{ [<state>get[text]] }}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
</div>
</$reveal>
<$reveal stateTitle=<<state>> type="nomatch" text="true" tag="div">
<div class="tc-dynaview-set-tiddler-when-visible tc-dynaview-expand-viewport" style="min-height: 5em;" data-dynaview-set-tiddler=<<state>> data-dynaview-set-value="true" data-dynaview-has-triggered={{{ [<state>get[text]] }}}>
</div>
</$reveal>
</$set>
</div>
</$tiddler>
</$vars>