]> git.datanom.net - qtadmin.git/blobdiff - js/timer.js
Navigate using icons
[qtadmin.git] / js / timer.js
index 3976030c0f4e329e57c54954b4d4b5f608f0b6c9..bf605e525a0119ae806b366a77385cca3f8f11da 100644 (file)
@@ -1,5 +1,5 @@
 /* vim: set ts=4 tw=4 sw=4 noet: */
-var timerRef=setInterval(function(){myTimer()},1000);
+var timerRef=setInterval(function(){myTimer()}, 300);
 var timeStart = new Date().getTime() + timeout;
 
 function myTimer() {
@@ -8,12 +8,12 @@ function myTimer() {
     var timeLeft = Math.round(((expire % 86400000) % 3600000) / 60000);
 
     if (timeLeft < 0) {
-        /*timeLeft = 'Expired';
-        document.getElementById("time").style.background = "red";*/
         clearInterval(timerRef);
         location.reload();
-    } else {
-        //timeLeft += 1;
+    } else if (timeLeft < 1) {
+        timeLeft = 'Expired';
+        document.getElementById("time").style.background = "red";
+    }else {
         timeLeft = '< ' + timeLeft + ' min';
     }
 
This page took 0.438681 seconds and 5 git commands to generate.