| 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..cac0d11efc42af03f482221ca7c846581e0c9791 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._savedFocus = WebInspector.saveFocusedElement(this._drawerTabbedPane);
|
| + else
|
| + this._savedFocus = null;
|
| },
|
|
|
| /**
|
| @@ -378,11 +385,11 @@ WebInspector.InspectorView.prototype = {
|
| return this._drawerTabbedPane.isShowing();
|
| },
|
|
|
| - closeDrawer: function()
|
| + _closeDrawer: function()
|
| {
|
| if (!this._drawerTabbedPane.isShowing())
|
| return;
|
| - WebInspector.restoreFocusFromElement(this._drawerTabbedPane.element);
|
| + this._savedFocus = WebInspector.restoreFocusedElement(this._drawerTabbedPane, this._savedFocus);
|
| this._drawerSplitWidget.hideSidebar(true);
|
| },
|
|
|
| @@ -592,9 +599,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;
|
| }
|
| }
|
|
|