diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index 1682e275e..65ce2ee88 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -53,6 +53,10 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { // Add a click event handler domNode.addEventListener("click",function (event) { var handled = false; + if(self.to) { + self.dispatchEvent({type: "tw-navigate", navigateTo: self.to, tiddlerTitle: self.getVariable("currentTiddler")}); + handled = true; + } if(self.message) { self.dispatchMessage(event); handled = true; @@ -110,6 +114,7 @@ Compute the internal state of the widget */ ButtonWidget.prototype.execute = function() { // Get attributes + this.to = this.getAttribute("to"); this.message = this.getAttribute("message"); this.param = this.getAttribute("param"); this.set = this.getAttribute("set"); @@ -129,7 +134,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ ButtonWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes["class"] || changedAttributes.selectedClass || changedAttributes.style || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup])) { + if(changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes["class"] || changedAttributes.selectedClass || changedAttributes.style || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup])) { this.refreshSelf(); return true; } diff --git a/core/ui/PageControls/controlpanel.tid b/core/ui/PageControls/controlpanel.tid index 27f762078..0c96c5bfe 100644 --- a/core/ui/PageControls/controlpanel.tid +++ b/core/ui/PageControls/controlpanel.tid @@ -1,4 +1,4 @@ title: $:/core/ui/PageControls/control-panel tags: $:/tags/PageControls -<$link to="$:/ControlPanel">{{$:/core/images/options-button}} \ No newline at end of file +<$button to="$:/ControlPanel" class="btn-invisible">{{$:/core/images/options-button}} \ No newline at end of file diff --git a/core/wiki/autosavestatus.tid b/core/wiki/autosavestatus.tid index 19c2d0053..edbc68ed7 100644 --- a/core/wiki/autosavestatus.tid +++ b/core/wiki/autosavestatus.tid @@ -3,10 +3,10 @@ title: $:/snippets/autosavestatus \define lingo-base() $:/language/ControlPanel/Saving/ <$reveal type="match" state="$:/config/AutoSave" text="yes"> <> -<$linkcatcher to="$:/config/AutoSave"><$link to="no"><> - +<$linkcatcher to="$:/config/AutoSave"><$button to="no"><> + <$reveal type="nomatch" state="$:/config/AutoSave" text="yes"> <> -<$linkcatcher to="$:/config/AutoSave"><$link to="yes"><> +<$linkcatcher to="$:/config/AutoSave"><$button to="yes"><> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid b/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid index e3ff99561..f2d018877 100644 --- a/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid @@ -1,12 +1,13 @@ title: ButtonWidget created: 201310241419 -modified: 201310300837 +modified: 201402220837 tags: widget ! Introduction The button widget displays an HTML `