Reverted changes

Revert to previous version
This commit is contained in:
Andrea Rendine
2016-02-17 14:16:39 +01:00
parent 7ba7f2247e
commit 68732ce0d9
+3 -5
View File
@@ -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);
}