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

Unified Diff: Source/devtools/front_end/ui/SidebarPane.js

Issue 1172643002: DevTools: migrate sidebar pane's titleElement to use Toolbar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: only using latin1 in css Created 5 years, 6 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 | « Source/devtools/front_end/sources/uiList.css ('k') | Source/devtools/front_end/ui/Toolbar.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/SidebarPane.js
diff --git a/Source/devtools/front_end/ui/SidebarPane.js b/Source/devtools/front_end/ui/SidebarPane.js
index 707f255d767fa0257d418280f4021ad1af3e0298..4e543cba736d343c8fa90aedb4c8f94fd060d1ff 100644
--- a/Source/devtools/front_end/ui/SidebarPane.js
+++ b/Source/devtools/front_end/ui/SidebarPane.js
@@ -37,8 +37,6 @@ WebInspector.SidebarPane = function(title)
this.setMinimumSize(25, 0);
this.element.className = "sidebar-pane"; // Override
- this.titleElement = createElementWithClass("div", "sidebar-pane-toolbar");
- this.bodyElement = this.element.createChild("div", "body");
this._title = title;
this._expandCallback = null;
this._paneVisible = true;
@@ -46,6 +44,19 @@ WebInspector.SidebarPane = function(title)
WebInspector.SidebarPane.prototype = {
/**
+ * @return {!WebInspector.Toolbar}
+ */
+ toolbar: function()
+ {
+ if (!this._toolbar) {
+ this._toolbar = new WebInspector.Toolbar();
+ this._toolbar.element.addEventListener("click", consumeEvent);
+ this.element.insertBefore(this._toolbar.element, this.element.firstChild);
+ }
+ return this._toolbar;
+ },
+
+ /**
* @return {string}
*/
title: function()
@@ -109,7 +120,6 @@ WebInspector.SidebarPaneTitle = function(container, pane)
this.element.tabIndex = 0;
this.element.addEventListener("click", this._toggleExpanded.bind(this), false);
this.element.addEventListener("keydown", this._onTitleKeyDown.bind(this), false);
- this.element.appendChild(this._pane.titleElement);
}
WebInspector.SidebarPaneTitle.prototype = {
@@ -165,6 +175,8 @@ WebInspector.SidebarPaneStack.prototype = {
{
var paneTitle = new WebInspector.SidebarPaneTitle(this.element, pane);
this._titleByPane.set(pane, paneTitle);
+ if (pane._toolbar)
+ paneTitle.element.appendChild(pane._toolbar.element);
pane._attached(this._setPaneVisible.bind(this, pane), paneTitle._expand.bind(paneTitle));
},
@@ -204,7 +216,8 @@ WebInspector.SidebarTabbedPane.prototype = {
{
var title = pane.title();
this.appendTab(title, title, pane);
- pane.element.appendChild(pane.titleElement);
+ if (pane._toolbar)
+ pane.element.insertBefore(pane._toolbar.element, pane.element.firstChild);
pane._attached(this._setPaneVisible.bind(this, pane), this.selectTab.bind(this, title));
},
« no previous file with comments | « Source/devtools/front_end/sources/uiList.css ('k') | Source/devtools/front_end/ui/Toolbar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698