| 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 ac06a4f9254645399c57e7418c34e66b38e8f103..6f031d87708a6d5bdc56aadfc505b771e3c1a9bc 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
|
| @@ -47,12 +47,12 @@ WebInspector.InspectorView = function()
|
| this._drawerSplitWidget.show(this.element);
|
|
|
| // Create drawer tabbed pane.
|
| - this._drawerTabbedLocation = WebInspector.viewManager.createTabbedLocation(this.showDrawer.bind(this), "drawer-view", true);
|
| + this._drawerTabbedLocation = WebInspector.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 WebInspector.ToolbarButton(WebInspector.UIString("Close drawer"), "delete-toolbar-item");
|
| - closeDrawerButton.addEventListener("click", this.closeDrawer.bind(this));
|
| + closeDrawerButton.addEventListener("click", this._closeDrawer.bind(this));
|
| this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton);
|
| this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement());
|
| this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane);
|
| @@ -363,11 +363,18 @@ WebInspector.InspectorView.prototype = {
|
| return panel;
|
| },
|
|
|
| - showDrawer: function()
|
| + /**
|
| + * @param {boolean} focus
|
| + */
|
| + _showDrawer: function(focus)
|
| {
|
| - if (!this._drawerTabbedPane.isShowing())
|
| - this._drawerSplitWidget.showBoth();
|
| - this._drawerTabbedPane.focus();
|
| + if (this._drawerTabbedPane.isShowing())
|
| + return;
|
| + this._drawerSplitWidget.showBoth();
|
| + if (focus)
|
| + this._focusRestorer = new WebInspector.WidgetFocusRestorer(this._drawerTabbedPane);
|
| + else
|
| + this._focusRestorer = null;
|
| },
|
|
|
| /**
|
| @@ -378,11 +385,12 @@ WebInspector.InspectorView.prototype = {
|
| return this._drawerTabbedPane.isShowing();
|
| },
|
|
|
| - closeDrawer: function()
|
| + _closeDrawer: function()
|
| {
|
| if (!this._drawerTabbedPane.isShowing())
|
| return;
|
| - WebInspector.restoreFocusFromElement(this._drawerTabbedPane.element);
|
| + if (this._focusRestorer)
|
| + this._focusRestorer.restore();
|
| this._drawerSplitWidget.hideSidebar(true);
|
| },
|
|
|
| @@ -592,9 +600,9 @@ WebInspector.InspectorView.DrawerToggleActionDelegate.prototype = {
|
| handleAction: function(context, actionId)
|
| {
|
| if (WebInspector.inspectorView.drawerVisible())
|
| - WebInspector.inspectorView.closeDrawer();
|
| + WebInspector.inspectorView._closeDrawer();
|
| else
|
| - WebInspector.inspectorView.showDrawer();
|
| + WebInspector.inspectorView._showDrawer(true);
|
| return true;
|
| }
|
| }
|
|
|