Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2401353004: Merge to 2883 "[DevTools] Support top/bottom show sidebar button." (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
index d83b72d604334f666186c9c5e7ce7044c38b10a3..9935719ab11ce12e9465e0efb17bf4e4001dfc93 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -80,7 +80,7 @@ WebInspector.SourcesPanel = function()
this._toggleNavigatorSidebarButton = this.editorView.createShowHideSidebarButton("navigator");
this._toggleDebuggerSidebarButton = this._splitWidget.createShowHideSidebarButton("debugger");
- this._showSourcesViewInPanel();
+ this.editorView.setMainWidget(this._sourcesView);
this._editorChanged(this._sourcesView.currentUISourceCode());
this._threadsSidebarPane = null;
@@ -184,9 +184,9 @@ WebInspector.SourcesPanel.prototype = {
var wrapper = WebInspector.SourcesPanel.WrapperView._instance;
if (wrapper && wrapper.isShowing()) {
WebInspector.inspectorView.setDrawerMinimized(true);
- WebInspector.SourcesPanel.updateResizer(this);
+ WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this);
}
- this._showSourcesViewInPanel();
+ this.editorView.setMainWidget(this._sourcesView);
},
willHide: function()
@@ -196,19 +196,10 @@ WebInspector.SourcesPanel.prototype = {
if (WebInspector.SourcesPanel.WrapperView.isShowing()) {
WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper();
WebInspector.inspectorView.setDrawerMinimized(false);
- WebInspector.SourcesPanel.updateResizer(this);
+ WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this);
}
},
- _showSourcesViewInPanel: function()
- {
- this._sourcesView.leftToolbar().removeToolbarItems();
- this._sourcesView.leftToolbar().appendToolbarItem(this._toggleNavigatorSidebarButton);
- this._sourcesView.rightToolbar().removeToolbarItems();
- this._sourcesView.rightToolbar().appendToolbarItem(this._toggleDebuggerSidebarButton);
- this.editorView.setMainWidget(this._sourcesView);
- },
-
/**
* @override
* @param {string} locationName
@@ -1052,7 +1043,7 @@ WebInspector.SourcesPanel.prototype = {
this._splitWidget.setVertical(!vertically);
this._splitWidget.element.classList.toggle("sources-split-view-vertical", vertically);
- WebInspector.SourcesPanel.updateResizer(this);
+ WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this);
// Create vertical box with stack.
var vbox = new WebInspector.VBox();
@@ -1339,12 +1330,23 @@ WebInspector.SourcesPanel.instance = function()
/**
* @param {!WebInspector.SourcesPanel} panel
*/
-WebInspector.SourcesPanel.updateResizer = function(panel)
+WebInspector.SourcesPanel.updateResizerAndSidebarButtons = function(panel)
{
- if (panel._splitWidget.isVertical() || (WebInspector.SourcesPanel.WrapperView.isShowing() && !WebInspector.inspectorView.isDrawerMinimized()))
+ panel._sourcesView.leftToolbar().removeToolbarItems();
+ panel._sourcesView.rightToolbar().removeToolbarItems();
+ panel._sourcesView.bottomToolbar().removeToolbarItems();
+ var isInWrapper = WebInspector.SourcesPanel.WrapperView.isShowing() && !WebInspector.inspectorView.isDrawerMinimized();
+ if (panel._splitWidget.isVertical() || isInWrapper)
panel._splitWidget.uninstallResizer(panel._sourcesView.toolbarContainerElement());
else
panel._splitWidget.installResizer(panel._sourcesView.toolbarContainerElement());
+ if (!isInWrapper) {
+ panel._sourcesView.leftToolbar().appendToolbarItem(panel._toggleNavigatorSidebarButton);
+ if (panel._splitWidget.isVertical())
+ panel._sourcesView.rightToolbar().appendToolbarItem(panel._toggleDebuggerSidebarButton);
+ else
+ panel._sourcesView.bottomToolbar().appendToolbarItem(panel._toggleDebuggerSidebarButton);
+ }
}
/**
@@ -1366,19 +1368,17 @@ WebInspector.SourcesPanel.WrapperView.prototype = {
this._showViewInWrapper();
else
WebInspector.inspectorView.setDrawerMinimized(true);
- WebInspector.SourcesPanel.updateResizer(WebInspector.SourcesPanel.instance());
+ WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.SourcesPanel.instance());
},
willHide: function()
{
WebInspector.inspectorView.setDrawerMinimized(false);
- setImmediate(() => WebInspector.SourcesPanel.updateResizer(WebInspector.SourcesPanel.instance()));
+ setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.SourcesPanel.instance()));
},
_showViewInWrapper: function()
{
- this._view.leftToolbar().removeToolbarItems();
- this._view.rightToolbar().removeToolbarItems();
this._view.show(this.element);
},
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698