Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js |
| index 51292fb948ea6522f66e0aad41934a33f9e05622..8015df791b528a59552ff6f6ace7ef0e6f32436b 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js |
| @@ -43,18 +43,9 @@ UI.InspectorView = class extends UI.VBox { |
| this._drawerSplitWidget.hideDefaultResizer(); |
| this._drawerSplitWidget.enableShowModeSaving(); |
| this._drawerSplitWidget.show(this.element); |
| - |
| - // Create drawer tabbed pane. |
| - this._drawerTabbedLocation = |
| - UI.viewManager.createTabbedLocation(this._showDrawer.bind(this, false), 'drawer-view', true); |
| - this._drawerTabbedLocation.enableMoreTabsButton(); |
| - this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane(); |
| - this._drawerTabbedPane.setMinimumSize(0, 27); |
| - var closeDrawerButton = new UI.ToolbarButton(Common.UIString('Close drawer'), 'largeicon-delete'); |
| - closeDrawerButton.addEventListener(UI.ToolbarButton.Events.Click, this._closeDrawer, this); |
| - this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton); |
| - this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement()); |
| - this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane); |
| + this._drawerBuilt = false; |
|
einbinder
2017/01/07 11:51:59
What is this used for?
|
| + if (this._drawerSplitWidget.showMode() === UI.SplitWidget.ShowMode.Both) |
| + this._drawerLocation(); |
| // Create main area tabbed pane. |
| this._tabbedLocation = UI.viewManager.createTabbedLocation( |
| @@ -110,7 +101,7 @@ UI.InspectorView = class extends UI.VBox { |
| * @return {?UI.ViewLocation} |
| */ |
| resolveLocation(locationName) { |
| - return this._drawerTabbedLocation; |
| + return this._drawerLocation(); |
| } |
| createToolbars() { |
| @@ -182,15 +173,32 @@ UI.InspectorView = class extends UI.VBox { |
| return /** @type {!UI.Panel} */ (UI.viewManager.materializedWidget(this._tabbedPane.selectedTabId || '')); |
| } |
| + _drawerLocation() { |
|
einbinder
2017/01/07 11:51:59
jsdoc @return
|
| + if (this._drawerTabbedLocation) |
| + return this._drawerTabbedLocation; |
| + this._drawerBuilt = true; |
| + this._drawerTabbedLocation = |
|
einbinder
2017/01/07 11:51:59
jsdoc @type this in constructor
|
| + UI.viewManager.createTabbedLocation(this._showDrawer.bind(this, false), 'drawer-view', true); |
| + this._drawerTabbedLocation.enableMoreTabsButton(); |
| + this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane(); |
|
einbinder
2017/01/07 11:51:59
var drawerTabbedPane =
|
| + this._drawerTabbedPane.setMinimumSize(0, 27); |
| + var closeDrawerButton = new UI.ToolbarButton(Common.UIString('Close drawer'), 'largeicon-delete'); |
| + closeDrawerButton.addEventListener(UI.ToolbarButton.Events.Click, this._closeDrawer, this); |
| + this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton); |
| + this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement()); |
| + this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane); |
| + return this._drawerTabbedLocation; |
| + } |
| + |
| /** |
| * @param {boolean} focus |
| */ |
| _showDrawer(focus) { |
| - if (this._drawerTabbedPane.isShowing()) |
| + if (this._drawerLocation().tabbedPane().isShowing()) |
| return; |
| this._drawerSplitWidget.showBoth(); |
| if (focus) |
| - this._focusRestorer = new UI.WidgetFocusRestorer(this._drawerTabbedPane); |
| + this._focusRestorer = new UI.WidgetFocusRestorer(this._drawerLocation().tabbedPane()); |
| else |
| this._focusRestorer = null; |
| } |
| @@ -199,11 +207,11 @@ UI.InspectorView = class extends UI.VBox { |
| * @return {boolean} |
| */ |
| drawerVisible() { |
| - return this._drawerTabbedPane.isShowing(); |
| + return this._drawerLocation().tabbedPane().isShowing(); |
|
einbinder
2017/01/07 11:51:59
!!this._drawerTabbedLocation && this._drawerLocati
|
| } |
| _closeDrawer() { |
| - if (!this._drawerTabbedPane.isShowing()) |
| + if (!this._drawerLocation().tabbedPane().isShowing()) |
|
einbinder
2017/01/07 11:51:59
!!this._drawerTabbedLocation && this._drawerLocati
|
| return; |
| if (this._focusRestorer) |
| this._focusRestorer.restore(); |