0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-25 18:47:57 +01:00

By leaving Button's enabled undefined the enable / disabled are always executed the first time

This commit is contained in:
peteruithoven 2014-01-31 15:21:05 +01:00
parent 735cff2edd
commit 6d71db1e84

View File

@ -11,7 +11,7 @@
Button.prototype = new jQuery(); Button.prototype = new jQuery();
function Button() { function Button() {
this.enabled = true; this.enabled;
var _clickEnabled = true; var _clickEnabled = true;
var _downTimerFPS = 20; var _downTimerFPS = 20;
@ -34,12 +34,12 @@ function Button() {
} }
this.enable = function() { this.enable = function() {
if(_self.enabled) { return; } if(_self.enabled === true) { return; }
_self.removeClass("disabled"); _self.removeClass("disabled");
_self.enabled = true; _self.enabled = true;
}; };
this.disable = function() { this.disable = function() {
if(!_self.enabled) { return; } if(_self.enabled === false) { return; }
_self.addClass("disabled"); _self.addClass("disabled");
_self.enabled = false; _self.enabled = false;
}; };