From a8798e4b775cb0882b91e9f01b96249b10847aa7 Mon Sep 17 00:00:00 2001 From: Jan Odvarko Date: Fri, 16 Aug 2019 06:18:16 +0000 Subject: [PATCH] Bug 1572689 - Properly restore size of the Search panel; r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D41936 --HG-- extra : moz-landing-system : lando --- .../netmonitor/src/components/MonitorPanel.js | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/devtools/client/netmonitor/src/components/MonitorPanel.js b/devtools/client/netmonitor/src/components/MonitorPanel.js index 5a7a068cb971..6208266a36cb 100644 --- a/devtools/client/netmonitor/src/components/MonitorPanel.js +++ b/devtools/client/netmonitor/src/components/MonitorPanel.js @@ -158,29 +158,32 @@ class MonitorPanel extends Component { ); } - renderSearchPanel(connector) { - const { isEmpty } = this.props; + renderSearchPanel() { + const { connector, isEmpty, panelOpen } = this.props; + const initialWidth = Services.prefs.getIntPref( "devtools.netmonitor.panes-search-width" ); const initialHeight = Services.prefs.getIntPref( "devtools.netmonitor.panes-search-height" ); + return SplitBox({ className: "devtools-responsive-container", initialWidth, initialHeight, minSize: "50px", maxSize: "80%", - splitterSize: 1, - startPanel: SearchPanel({ - ref: "searchPanel", - connector, - }), + splitterSize: panelOpen ? 1 : 0, + startPanel: + panelOpen && + SearchPanel({ + ref: "searchPanel", + connector, + }), endPanel: RequestList({ isEmpty, connector }), endPanelControl: false, vert: true, - onControlledPanelResized: () => {}, }); } @@ -188,12 +191,10 @@ class MonitorPanel extends Component { const { actions, connector, - isEmpty, networkDetailsOpen, openLink, openSplitConsole, sourceMapService, - panelOpen, } = this.props; const initialWidth = Services.prefs.getIntPref( @@ -204,10 +205,6 @@ class MonitorPanel extends Component { "devtools.netmonitor.panes-network-details-height" ); - const startPanel = panelOpen - ? this.renderSearchPanel(connector) - : RequestList({ isEmpty, connector }); - return div( { className: "monitor-panel" }, Toolbar({ @@ -218,12 +215,12 @@ class MonitorPanel extends Component { }), SplitBox({ className: "devtools-responsive-container", - initialWidth: initialWidth, - initialHeight: initialHeight, + initialWidth, + initialHeight, minSize: "50px", maxSize: "80%", splitterSize: networkDetailsOpen ? 1 : 0, - startPanel, + startPanel: this.renderSearchPanel(), endPanel: networkDetailsOpen && NetworkDetailsPanel({