mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Reverted changes
Revert to previous version
This commit is contained in:
+3
-5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user