Fixed issue with selectable state of buttons
This commit is contained in:
@@ -80,8 +80,12 @@ function TextButton(id, text, settings) {
|
|||||||
this.onClick = function(callback) {
|
this.onClick = function(callback) {
|
||||||
_callback = callback || function() {};
|
_callback = callback || function() {};
|
||||||
this.on('mousedown', function (e) {
|
this.on('mousedown', function (e) {
|
||||||
this.__active = !this.__active;
|
// As inactive buttons are still clickable, we first check if the button is 'selectable'.
|
||||||
handleMouseDown.call(this, e);
|
// Only then we should do stuff.
|
||||||
|
if (this.selectable) {
|
||||||
|
this.__active = !this.__active;
|
||||||
|
handleMouseDown.call(this, e);
|
||||||
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user