Bläddra i källkod

HUE-3459 [assist] Clear the height interval on update

Johan Ahlen 9 år sedan
förälder
incheckning
fd38558cf4
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 5 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -1179,7 +1179,11 @@
         var adjustHeightSingle = function () {
           $allPanels.height($container.innerHeight() - allExtrasHeight);
         };
-        window.setInterval(adjustHeightSingle, 800);
+
+        window.clearInterval($container.data('height_interval'));
+        var heightAdjustInterval = window.setInterval(adjustHeightSingle, 800);
+        $container.data('height_interval', heightAdjustInterval);
+
         $(window).resize(adjustHeightSingle);
         huePubSub.subscribe('assist.forceRender', function () {
           window.setTimeout(adjustHeightSingle, 200);