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
1 changed files with 4 additions and 4 deletions

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;
};