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 291af57..55de4c9 100644 (file)
@@ -2420,11 +2420,12 @@ function LuCI2()
                        var setTimer, runTimer;
 
                        setTimer = function() {
                        var setTimer, runTimer;
 
                        setTimer = function() {
-                               self._timeouts[index] = window.setTimeout(runTimer, interval);
+                               if (self._timeouts)
+                                       self._timeouts[index] = window.setTimeout(runTimer, interval);
                        };
 
                        runTimer = function() {
                        };
 
                        runTimer = function() {
-                               _luci2.deferrable(func.call(self)).then(setTimer);
+                               _luci2.deferrable(func.call(self)).then(setTimer, setTimer);
                        };
 
                        runTimer();
                        };
 
                        runTimer();