Update the reveal widget to allow control over content retention

Thus bringing back the animation of the opening and closing of the info
panel.
This commit is contained in:
Jermolene
2014-02-12 08:32:19 +00:00
parent dd451800c7
commit 5c66bc6dbc
3 changed files with 13 additions and 5 deletions
+7 -3
View File
@@ -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;
}