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) {
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({