Преглед изворни кода

[core] Remove window resize delays for IE8

Enrico Berti пре 9 година
родитељ
комит
00ee249

+ 1 - 11
apps/jobbrowser/src/jobbrowser/static/jobbrowser/js/utils.js

@@ -45,20 +45,10 @@ function resizeLogs(element) {
 }
 
 var _resizeTimeout = -1;
-var _winWidth = $(window).width();
-var _winHeight = $(window).height();
 
 function enableResizeLogs() {
   $(window).on("resize", function () {
-    window.clearTimeout(_resizeTimeout);
-    _resizeTimeout = window.setTimeout(function () {
-      // prevents endless loop in IE8
-      if (_winWidth != $(window).width() || _winHeight != $(window).height()) {
-        $(document).trigger("resized");
-        _winWidth = $(window).width();
-        _winHeight = $(window).height();
-      }
-    }, 200);
+    $(document).trigger("resized");
   });
 }
 

+ 2 - 12
apps/rdbms/src/rdbms/templates/execute.mako

@@ -407,8 +407,6 @@ ${ commonshare() | n,unicode }
     $("#navigatorTables").css("max-height", ($(window).height() - 340) + "px").css("overflow-y", "auto");
 
     var resizeTimeout = -1;
-    var winWidth = $(window).width();
-    var winHeight = $(window).height();
 
     var resizeNavigator = function() {
       $("#navigatorTables").css("max-height", ($(window).height() - 380) + "px").css("overflow-y", "auto");
@@ -416,16 +414,8 @@ ${ commonshare() | n,unicode }
     }
 
     $(window).on("resize", function () {
-      window.clearTimeout(resizeTimeout);
-      resizeTimeout = window.setTimeout(function () {
-        // prevents endless loop in IE8
-        if (winWidth != $(window).width() || winHeight != $(window).height()) {
-          codeMirror.setSize("95%", 100);
-          winWidth = $(window).width();
-          winHeight = $(window).height();
-          resizeNavigator();
-        }
-      }, 200);
+      codeMirror.setSize("95%", 100);
+      resizeNavigator();
     });
     resizeNavigator();