diff --git a/core/modules/widgets/reveal.js b/core/modules/widgets/reveal.js index 37f709f44..6b7558a2c 100755 --- a/core/modules/widgets/reveal.js +++ b/core/modules/widgets/reveal.js @@ -89,6 +89,7 @@ RevealWidget.prototype.execute = function() { this["class"] = this.getAttribute("class",""); this["default"] = this.getAttribute("default",""); this.animate = this.getAttribute("animate","no"); + this.retain = this.getAttribute("retain","no"); this.openAnimation = this.animate === "no" ? undefined : "open"; this.closeAnimation = this.animate === "no" ? undefined : "close"; // Compute the title of the state tiddler and read it @@ -157,9 +158,12 @@ RevealWidget.prototype.refresh = function(changedTiddlers) { } else { var refreshed = false; if(changedTiddlers[this.stateTitle]) { - // this.updateState(); - this.refreshSelf(); - refreshed = true; + if(this.retain === "yes") { + this.updateState(); + } else { + this.refreshSelf(); + refreshed = true; + } } return this.refreshChildren(changedTiddlers) || refreshed; } diff --git a/core/ui/ViewTemplate/title.tid b/core/ui/ViewTemplate/title.tid index 080fb82ca..22b25ffbd 100644 --- a/core/ui/ViewTemplate/title.tid +++ b/core/ui/ViewTemplate/title.tid @@ -8,7 +8,7 @@ fill:$(foregroundColor)$; <$set name="foregroundColor" value={{!!color}}>>><$transclude tiddler={{!!icon}}/> <$view field="title"/> -<$reveal type="nomatch" text="" default="" state=<> class="tw-tiddler-info tw-popup" animate="yes"> +<$reveal type="nomatch" text="" default="" state=<> class="tw-tiddler-info tw-popup" animate="yes" retain="yes"> <$transclude tiddler="$:/core/ui/TiddlerInfo"/> diff --git a/editions/tw5.com/tiddlers/widgets/RevealWidget.tid b/editions/tw5.com/tiddlers/widgets/RevealWidget.tid index 1daa25a88..454bf132c 100644 --- a/editions/tw5.com/tiddlers/widgets/RevealWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/RevealWidget.tid @@ -1,5 +1,5 @@ created: 20131024141900000 -modified: 20131212181426191 +modified: 20140211232346858 tags: widget title: RevealWidget type: text/vnd.tiddlywiki @@ -22,6 +22,10 @@ The content of the `<$reveal>` widget is displayed according to the rules given |text |The text to match when the type is ''match'' and ''nomatch'' | |position |The position used for the popup when the type is ''popup''. Can be ''left'', ''above'', ''aboveright'', ''right'', ''belowleft'' or ''below'' | |default |Default value to use when the state tiddler | +|animate |Set to "yes" to animate opening and closure (defaults to "no") | +|retain |Set to "yes" to force the content to be retained even when hidden (defaults to "no")| + +Retaining the content when hidden can give poor performance since the hidden content requires refresh processing even though it is not displayed. On the other hand, the content can be revealed much more quickly. Note that setting ''animate="yes"'' will also force ''retain="yes"''. ! Examples