luci2: don't re-set timeout if view is finished already, re-set timeout even if the...
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 22 Oct 2013 19:06:22 +0000 (19:06 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 22 Oct 2013 19:06:22 +0000 (19:06 +0000)
luci2/htdocs/luci2/luci2.js

index 291af572d31119ec0e318aa03a68220b420ff3bd..55de4c97e2abc181ee37b05bdb26b8f972d40b3c 100644 (file)
@@ -2420,11 +2420,12 @@ function LuCI2()
                        var setTimer, runTimer;
 
                        setTimer = function() {
-                               self._timeouts[index] = window.setTimeout(runTimer, interval);
+                               if (self._timeouts)
+                                       self._timeouts[index] = window.setTimeout(runTimer, interval);
                        };
 
                        runTimer = function() {
-                               _luci2.deferrable(func.call(self)).then(setTimer);
+                               _luci2.deferrable(func.call(self)).then(setTimer, setTimer);
                        };
 
                        runTimer();