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:
parent
735cff2edd
commit
6d71db1e84
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user