diff --git a/script/Button.js b/script/Button.js index 4d92077..35d46ef 100644 --- a/script/Button.js +++ b/script/Button.js @@ -13,7 +13,7 @@ var Button = { .addClass('button') .text(typeof(options.text) != 'undefined' ? options.text : "button") .click(function() { - if(!$(this).hasClass('disabled') && (!Events.paused || $(this).data("handler") == Events.togglePause)) { + if(!$(this).hasClass('disabled')) { Button.cooldown($(this)); $(this).data("handler")($(this)); } @@ -73,6 +73,7 @@ var Button = { // param "start" takes value from cooldown time if not specified var start, left; switch(option){ + // a switch will allow for several uses of cooldown function case 'state': if(!$SM.get(id)){ return; @@ -80,10 +81,6 @@ var Button = { start = Math.min($SM.get(id), cd); left = (start / cd).toFixed(4); break; - case 'pause': - left = (btn.children('div.cooldown').width() / btn.innerWidth()).toFixed(4); - start = cd * left; - break; default: start = cd; left = 1; @@ -110,6 +107,7 @@ var Button = { }, clearCooldown: function(btn, ended) { + var ended = ended || false; if(!ended){ $('div.cooldown', btn).stop(true, true); }