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