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
This commit is contained in:
Jan Odvarko 2019-08-16 06:18:16 +00:00
Родитель 4d21f3222e
Коммит a8798e4b77
1 изменённых файлов: 14 добавлений и 17 удалений

Просмотреть файл

@ -158,29 +158,32 @@ class MonitorPanel extends Component {
); );
} }
renderSearchPanel(connector) { renderSearchPanel() {
const { isEmpty } = this.props; const { connector, isEmpty, panelOpen } = this.props;
const initialWidth = Services.prefs.getIntPref( const initialWidth = Services.prefs.getIntPref(
"devtools.netmonitor.panes-search-width" "devtools.netmonitor.panes-search-width"
); );
const initialHeight = Services.prefs.getIntPref( const initialHeight = Services.prefs.getIntPref(
"devtools.netmonitor.panes-search-height" "devtools.netmonitor.panes-search-height"
); );
return SplitBox({ return SplitBox({
className: "devtools-responsive-container", className: "devtools-responsive-container",
initialWidth, initialWidth,
initialHeight, initialHeight,
minSize: "50px", minSize: "50px",
maxSize: "80%", maxSize: "80%",
splitterSize: 1, splitterSize: panelOpen ? 1 : 0,
startPanel: SearchPanel({ startPanel:
panelOpen &&
SearchPanel({
ref: "searchPanel", ref: "searchPanel",
connector, connector,
}), }),
endPanel: RequestList({ isEmpty, connector }), endPanel: RequestList({ isEmpty, connector }),
endPanelControl: false, endPanelControl: false,
vert: true, vert: true,
onControlledPanelResized: () => {},
}); });
} }
@ -188,12 +191,10 @@ class MonitorPanel extends Component {
const { const {
actions, actions,
connector, connector,
isEmpty,
networkDetailsOpen, networkDetailsOpen,
openLink, openLink,
openSplitConsole, openSplitConsole,
sourceMapService, sourceMapService,
panelOpen,
} = this.props; } = this.props;
const initialWidth = Services.prefs.getIntPref( const initialWidth = Services.prefs.getIntPref(
@ -204,10 +205,6 @@ class MonitorPanel extends Component {
"devtools.netmonitor.panes-network-details-height" "devtools.netmonitor.panes-network-details-height"
); );
const startPanel = panelOpen
? this.renderSearchPanel(connector)
: RequestList({ isEmpty, connector });
return div( return div(
{ className: "monitor-panel" }, { className: "monitor-panel" },
Toolbar({ Toolbar({
@ -218,12 +215,12 @@ class MonitorPanel extends Component {
}), }),
SplitBox({ SplitBox({
className: "devtools-responsive-container", className: "devtools-responsive-container",
initialWidth: initialWidth, initialWidth,
initialHeight: initialHeight, initialHeight,
minSize: "50px", minSize: "50px",
maxSize: "80%", maxSize: "80%",
splitterSize: networkDetailsOpen ? 1 : 0, splitterSize: networkDetailsOpen ? 1 : 0,
startPanel, startPanel: this.renderSearchPanel(),
endPanel: endPanel:
networkDetailsOpen && networkDetailsOpen &&
NetworkDetailsPanel({ NetworkDetailsPanel({