There is a timer that counts the minute.
There are buttons "pause", "start again" and "continue".
The first and second work, but the latter does not work.
Tell me where to dig?
if(channel == 'stopTimer') { timer_on = false; return; } if(channel == 'continueTimer') { timer_on = true; return; } if (channel == 'AddTime') { timer_on = false; setTimeout(function () { timer_on = true; startTimer(TimeToAdd * 60); }, 1e3); return; } Here is the function itself:
function startTimer(time) { TimerProcceed = true; var time_def = time; var timer = setInterval(function() { if(timer_on == true) { time--; postTime(time, time_def); } }, 1000); }