Index: Source/devtools/front_end/SplitView.js |
diff --git a/Source/devtools/front_end/SplitView.js b/Source/devtools/front_end/SplitView.js |
index 8a69df9d84d3f7b3d1106a8ad89ba0651b811feb..1128ee75c3f663f631df9a2e780538f653184072 100644 |
--- a/Source/devtools/front_end/SplitView.js |
+++ b/Source/devtools/front_end/SplitView.js |
@@ -42,8 +42,6 @@ WebInspector.SplitView = function(isVertical, secondIsSidebar, settingName, defa |
this.registerRequiredCSS("splitView.css"); |
this.element.classList.add("split-view"); |
- WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); |
- |
this._mainView = new WebInspector.VBox(); |
this._mainView.makeLayoutBoundary(); |
this._mainElement = this._mainView.element; |
@@ -572,7 +570,13 @@ WebInspector.SplitView.prototype = { |
wasShown: function() |
{ |
- this._updateLayout(); |
+ this._forceUpdateLayout(); |
+ WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); |
+ }, |
+ |
+ willHide: function() |
+ { |
+ WebInspector.zoomManager.removeEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); |
}, |
onResize: function() |
@@ -779,15 +783,19 @@ WebInspector.SplitView.prototype = { |
setting.set(state); |
}, |
+ _forceUpdateLayout: function() |
+ { |
+ // Force layout even if sidebar size does not change. |
+ this._sidebarSize = -1; |
+ this._updateLayout(); |
+ }, |
+ |
/** |
* @param {!WebInspector.Event} event |
*/ |
_onZoomChanged: function(event) |
{ |
- // Force layout even if sidebar size does not change. |
- this._sidebarSize = -1; |
- if (this.isShowing()) |
- this._updateLayout(); |
+ this._forceUpdateLayout(); |
}, |
/** |