From b8addaa520d2e51337f91b403579eaf776707f91 Mon Sep 17 00:00:00 2001 From: cehmke Date: Sun, 10 May 2015 13:26:00 +0200 Subject: [PATCH] use of getTextRefence in isSelected Instead of a particular implementation make use of the overall function getTextReference to determine the current value. Add a missing semicolon. --- core/modules/widgets/button.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index bdab256d6..49386b8b5 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -107,11 +107,10 @@ ButtonWidget.prototype.allowActionPropagation = function() { ButtonWidget.prototype.getBoundingClientRect = function() { return this.domNodes[0].getBoundingClientRect(); -} +}; ButtonWidget.prototype.isSelected = function() { - var tiddler = this.wiki.getTiddler(this.set); - return tiddler ? tiddler.fields.text === this.setTo : this.defaultSetValue === this.setTo; + return this.wiki.getTextReference(this.set,"",this.getVariable("currentTiddler")) === this.setTo; }; ButtonWidget.prototype.isPoppedUp = function() {