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