]> git.datanom.net - qtadmin.git/commitdiff
Fix timer
authorMichael Rasmussen <mir@datanom.net>
Wed, 3 Jun 2015 23:14:06 +0000 (01:14 +0200)
committerMichael Rasmussen <mir@datanom.net>
Wed, 3 Jun 2015 23:14:06 +0000 (01:14 +0200)
js/timer.js

index d166ffd1abf26a11fbd4ce29d2e8903a7ba24c31..482565577923f1045d20768cee0bcca981bdb26f 100644 (file)
@@ -8,7 +8,7 @@ function myTimer() {
     var expire = timeStart - elapsed;
     var timeLeft = Math.round(((expire % 86400000) % 3600000) / 60000);
 
-    if (timeLeft < 1) {
+    if (timeLeft < 0) {
         clearInterval(timerRef);
         console.log('Session expired, reload page');
         last = -1;
@@ -16,7 +16,7 @@ function myTimer() {
     } else if (timeLeft < 2) {
         if (timeLeft < last || last == -1) {
             last = timeLeft;
-            timeLeft = 'Expired';
+            timeLeft = '< ' + timeLeft + ' min';
             console.log('Session soon to expire');
             document.getElementById("time").style.background = "red";
             document.getElementById("timer").innerHTML = timeLeft;
This page took 0.033488 seconds and 5 git commands to generate.