From 7ed29240c80d295cff6d46e364c9a3b153dcc9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 25 Sep 2017 11:45:07 +0200 Subject: [PATCH] =?UTF-8?q?replaced=20property=20name=20for=20=E2=80=9Cena?= =?UTF-8?q?bled=E2=80=9D=20with=20=E2=80=9CisDisabled=E2=80=9D=20for=20Pus?= =?UTF-8?q?hButtons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- history.txt | 1 + widgets.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/history.txt b/history.txt index 816ee939..6baeecff 100755 --- a/history.txt +++ b/history.txt @@ -3648,6 +3648,7 @@ Fixes: ------ * GUI, Symbols: added “visible stepping” toggle button to the control bar * fixed camera retina issues, thanks, Bernat!! +* Widgets: inverted property name for “enabled” to “isDisabled” for PushButtons v4.1 Features: diff --git a/widgets.js b/widgets.js index 7290f20d..7d15fd1f 100644 --- a/widgets.js +++ b/widgets.js @@ -168,7 +168,7 @@ PushButtonMorph.prototype.init = function ( this.hint = hint || null; this.template = template || null; // for pre-computed backbrounds // if a template is specified, its background images are used as cache - this.enabled = true; + this.isDisabled = false; // initialize inherited properties: TriggerMorph.uber.init.call(this); @@ -205,11 +205,10 @@ PushButtonMorph.prototype.mouseDownLeft = function () { }; PushButtonMorph.prototype.mouseClickLeft = function () { - if (this.enabled) { - PushButtonMorph.uber.mouseClickLeft.call(this); - if (this.label) { - this.label.setCenter(this.center()); - } + if (this.isDisabled) {return; } + PushButtonMorph.uber.mouseClickLeft.call(this); + if (this.label) { + this.label.setCenter(this.center()); } }; @@ -485,7 +484,7 @@ PushButtonMorph.prototype.createLabel = function () { // PushButtonMorph states PushButtonMorph.prototype.disable = function () { - this.enabled = false; + this.isDisabled = true; this.forAllChildren(function (child) { child.alpha = 0.3; }); @@ -493,7 +492,7 @@ PushButtonMorph.prototype.disable = function () { }; PushButtonMorph.prototype.enable = function () { - this.enabled = true; + this.isDisabled = false; this.forAllChildren(function (child) { child.alpha = 1; });