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

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

Issue 2175903002: DevTools: follow-up to view introduction, fix styles css. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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/SidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SidebarPane.js b/third_party/WebKit/Source/devtools/front_end/ui/SidebarPane.js
index 956e687bb9bc931f0e35bf4538db8b641799683f..1284f671c52605d52907d14e5ebca76e73dec9d2 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SidebarPane.js
@@ -132,17 +132,22 @@ WebInspector.SidebarTabbedPane = function()
this.element.classList.add("sidebar-pane-container", "sidebar-tabbed-pane");
}
+WebInspector.SidebarTabbedPane._toolbarSymbol = Symbol("toolbar");
+
WebInspector.SidebarTabbedPane.prototype = {
/**
* @param {!WebInspector.View} pane
*/
addPane: function(pane)
{
- var title = pane.title();
+ // Detach first to trigger toolbar cleanup.
+ pane.detach();
+ var title = pane.title();
var toolbarItems = pane.toolbarItems();
if (toolbarItems.length) {
var toolbar = new WebInspector.Toolbar("");
+ pane[WebInspector.SidebarTabbedPane._toolbarSymbol] = toolbar;
pane.element.insertBefore(toolbar.element, pane.element.firstChild);
for (var item of toolbarItems)
toolbar.appendToolbarItem(item);
@@ -153,6 +158,19 @@ WebInspector.SidebarTabbedPane.prototype = {
},
/**
+ * @param {!WebInspector.Widget} widget
+ * @override
+ */
+ childWasDetached: function(widget)
+ {
+ WebInspector.TabbedPane.prototype.childWasDetached.call(this, widget);
+
+ var toolbar = widget[WebInspector.SidebarTabbedPane._toolbarSymbol];
+ if (toolbar)
+ toolbar.element.remove();
+ },
+
+ /**
* @param {!WebInspector.View} pane
* @param {boolean} visible
*/

Powered by Google App Engine
This is Rietveld 408576698