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) {
|
||||
_callback = callback || function() {};
|
||||
this.on('mousedown', function (e) {
|
||||
this.__active = !this.__active;
|
||||
handleMouseDown.call(this, e);
|
||||
// As inactive buttons are still clickable, we first check if the button is 'selectable'.
|
||||
// Only then we should do stuff.
|
||||
if (this.selectable) {
|
||||
this.__active = !this.__active;
|
||||
handleMouseDown.call(this, e);
|
||||
}
|
||||
}.bind(this));
|
||||
return this;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user