0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-22 13:13:48 +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,8 +11,8 @@
Button.prototype = new jQuery();
function Button() {
this.enabled = true;
this.enabled;
var _clickEnabled = true;
var _downTimerFPS = 20;
var _timer;
@ -34,12 +34,12 @@ function Button() {
}
this.enable = function() {
if(_self.enabled) { return; }
if(_self.enabled === true) { return; }
_self.removeClass("disabled");
_self.enabled = true;
};
this.disable = function() {
if(!_self.enabled) { return; }
if(_self.enabled === false) { return; }
_self.addClass("disabled");
_self.enabled = false;
};