mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-06 04:27:14 +08:00
Reverted changes
Revert to previous version
This commit is contained in:
+3
-5
@@ -13,7 +13,7 @@ var Button = {
|
|||||||
.addClass('button')
|
.addClass('button')
|
||||||
.text(typeof(options.text) != 'undefined' ? options.text : "button")
|
.text(typeof(options.text) != 'undefined' ? options.text : "button")
|
||||||
.click(function() {
|
.click(function() {
|
||||||
if(!$(this).hasClass('disabled') && (!Events.paused || $(this).data("handler") == Events.togglePause)) {
|
if(!$(this).hasClass('disabled')) {
|
||||||
Button.cooldown($(this));
|
Button.cooldown($(this));
|
||||||
$(this).data("handler")($(this));
|
$(this).data("handler")($(this));
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,7 @@ var Button = {
|
|||||||
// param "start" takes value from cooldown time if not specified
|
// param "start" takes value from cooldown time if not specified
|
||||||
var start, left;
|
var start, left;
|
||||||
switch(option){
|
switch(option){
|
||||||
|
// a switch will allow for several uses of cooldown function
|
||||||
case 'state':
|
case 'state':
|
||||||
if(!$SM.get(id)){
|
if(!$SM.get(id)){
|
||||||
return;
|
return;
|
||||||
@@ -80,10 +81,6 @@ var Button = {
|
|||||||
start = Math.min($SM.get(id), cd);
|
start = Math.min($SM.get(id), cd);
|
||||||
left = (start / cd).toFixed(4);
|
left = (start / cd).toFixed(4);
|
||||||
break;
|
break;
|
||||||
case 'pause':
|
|
||||||
left = (btn.children('div.cooldown').width() / btn.innerWidth()).toFixed(4);
|
|
||||||
start = cd * left;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
start = cd;
|
start = cd;
|
||||||
left = 1;
|
left = 1;
|
||||||
@@ -110,6 +107,7 @@ var Button = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
clearCooldown: function(btn, ended) {
|
clearCooldown: function(btn, ended) {
|
||||||
|
var ended = ended || false;
|
||||||
if(!ended){
|
if(!ended){
|
||||||
$('div.cooldown', btn).stop(true, true);
|
$('div.cooldown', btn).stop(true, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user