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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.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
Index: third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js
index 23d3c9565689f8ad6ec5462e922c6f0dd784d6de..894f333a07af7c89aa09957a0041230bbb6a3866 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js
@@ -887,8 +887,6 @@ WebInspector.SplitWidget.prototype = {
*/
createShowHideSidebarButton: function(title)
{
- console.assert(this.isVertical(), "Buttons for split widget with horizontal split are not supported yet.");
-
this._showHideSidebarButtonTitle = WebInspector.UIString(title);
this._showHideSidebarButton = new WebInspector.ToolbarButton("", "sidebar-toolbar-item");
this._showHideSidebarButton.addEventListener("click", buttonClicked.bind(this));
@@ -914,7 +912,8 @@ WebInspector.SplitWidget.prototype = {
if (!this._showHideSidebarButton)
return;
var sidebarHidden = this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain;
- this._showHideSidebarButton.setState((this.isSidebarSecond() ? "right" : "left") + "-" + (sidebarHidden ? "show" : "hide"));
+ var side = this.isVertical() ? (this.isSidebarSecond() ? "right" : "left") : (this.isSidebarSecond() ? "bottom" : "top");
+ this._showHideSidebarButton.setState(side + "-" + (sidebarHidden ? "show" : "hide"));
this._showHideSidebarButton.setTitle(sidebarHidden ? WebInspector.UIString("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s", this._showHideSidebarButtonTitle));
},

Powered by Google App Engine
This is Rietveld 408576698