bug 463538: avoid superfluous resizes
authorTaras Glek <tglek@mozilla.com>
Mon, 10 Nov 2008 11:15:25 -0800
changeset 64949 fee2fec6f7455fe340ce83594246ce3891c1ec23
parent 64948 755acdedcbd04a546983c1d7c848c4108d834f7a
child 64950 5e68c61c435ee70462bc20118d74b43ef6324a69
push idunknown
push userunknown
push dateunknown
bugs463538
bug 463538: avoid superfluous resizes
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -439,31 +439,32 @@ var BrowserUI = {
     Shortcuts.init();
   },
 
   switchPane : function(id) {
     document.getElementById("panel-items").selectedPanel = document.getElementById(id);
   },
 
   _sizeControls : function(aEvent) {
+    if (window != aEvent.target) {
+      return
+    }
     var rect = document.getElementById("browser-container").getBoundingClientRect();
     var containerW = rect.right - rect.left;
     var containerH = rect.bottom - rect.top;
     var toolbar = document.getElementById("toolbar-main");
     var toolbarH = toolbar.boxObject.height;
 
     var sidebar = document.getElementById("browser-controls");
     var panelUI = document.getElementById("panel-container");
     var tabbar = document.getElementById("tab-list-container");
-    if (window == aEvent.target) {
-      tabbar.left = -tabbar.boxObject.width;
-      panelUI.left = containerW + sidebar.boxObject.width;
-      sidebar.left = containerW;
-      sidebar.height = tabbar.height = (panelUI.height = containerH) - toolbarH;
-    }
+    tabbar.left = -tabbar.boxObject.width;
+    panelUI.left = containerW + sidebar.boxObject.width;
+    sidebar.left = containerW;
+    sidebar.height = tabbar.height = (panelUI.height = containerH) - toolbarH;
     panelUI.width = containerW - sidebar.boxObject.width - tabbar.boxObject.width;
 
     var popup = document.getElementById("popup_autocomplete");
     toolbar.width = containerW;
     popup.height = containerH - toolbarH;
   },
 
   init : function() {