From 79e428757b5562bd4a925b9b0428ea4ba70ad05a Mon Sep 17 00:00:00 2001 From: Skeeve Date: Mon, 24 Nov 2014 07:38:58 +0100 Subject: [PATCH] allow empty state tiddlers and missing state attributes act as missing state tiddlers As described here: https://groups.google.com/d/msg/tiddlywikidev/ODJhIw6-UjQ/3ZKrlA4B810J I think it would be a good small enhancement as the reveal widget can now be used in previously impossible ways. --- core/modules/widgets/reveal.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/core/modules/widgets/reveal.js b/core/modules/widgets/reveal.js index 66a87f1af..2afa1d9ee 100755 --- a/core/modules/widgets/reveal.js +++ b/core/modules/widgets/reveal.js @@ -106,20 +106,18 @@ Read the state tiddler */ RevealWidget.prototype.readState = function() { // Read the information from the state tiddler - if(this.stateTitle) { - var state = this.wiki.getTextReference(this.stateTitle,this["default"],this.getVariable("currentTiddler")); - switch(this.type) { - case "popup": - this.readPopupState(state); - break; - case "match": - this.readMatchState(state); - break; - case "nomatch": - this.readMatchState(state); - this.isOpen = !this.isOpen; - break; - } + var state = this.stateTitle ? this.wiki.getTextReference(this.stateTitle,this["default"],this.getVariable("currentTiddler")) : this["default"]; + switch(this.type) { + case "popup": + this.readPopupState(state); + break; + case "match": + this.readMatchState(state); + break; + case "nomatch": + this.readMatchState(state); + this.isOpen = !this.isOpen; + break; } };