From df63ccb6514c9f1c64f20b9a67fa3cff3971da6e Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Wed, 17 Feb 2016 10:27:38 +0100 Subject: [PATCH] Switch cooldown Easy way to switch cooldown on pause button according to new button option --- script/events.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/script/events.js b/script/events.js index 156e81a..b26e42a 100644 --- a/script/events.js +++ b/script/events.js @@ -83,7 +83,7 @@ var Events = { var pause = new Button.Button({ id: 'pause', text: '', - cooldown: Events._LEAVE_COOLDOWN, + cooldown: Events._PAUSE_COOLDOWN, click: Events.togglePause }).appendTo(pauseBox); $('').addClass('text').insertBefore(pause.children('.cooldown')); @@ -175,11 +175,10 @@ var Events = { } switch(state){ case 'set': + Button.cooldown(btn, Events._LEAVE_COOLDOWN); log = 'started'; - time = btn.data('cooldown') * 1000; + time = Events._LEAVE_COOLDOWN * 1000; target = $(); - Button.cooldown(btn); - btn.data('cooldown',Events._PAUSE_COOLDOWN); break; case 'end': Button.setDisabled(btn, true);