From 6d71db1e84281ef27df087f3d41ce19b745323ca Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 31 Jan 2014 15:21:05 +0100 Subject: [PATCH] By leaving Button's enabled undefined the enable / disabled are always executed the first time --- js/Button.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/Button.js b/js/Button.js index a630bf3..cca8147 100644 --- a/js/Button.js +++ b/js/Button.js @@ -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; };