Forcing cooldown

Added an option.
Button.cooldown(btn, X) where X is a number, forces a one-time cooldown of X seconds for btn.
This commit is contained in:
Andrea Rendine
2016-02-17 10:19:32 +01:00
parent e4bb616a93
commit ac34b717d3
+3
View File
@@ -70,6 +70,9 @@ var Button = {
var cd = btn.data("cooldown");
var id = 'cooldown.'+ btn.attr('id');
if(cd > 0) {
if(typeof option == 'number') {
cd = option;
}
// param "start" takes value from cooldown time if not specified
var start, left;
switch(option){