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

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

Issue 944343002: DevTools: migrate treeoutline from hasChildren to is/setExpandable(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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: Source/devtools/front_end/ui/SidebarTreeElement.js
diff --git a/Source/devtools/front_end/ui/SidebarTreeElement.js b/Source/devtools/front_end/ui/SidebarTreeElement.js
index 7963b7682f918e438602f447fd011d10e49ef627..9259239ba10de3903413cba96569b2d5092589d6 100644
--- a/Source/devtools/front_end/ui/SidebarTreeElement.js
+++ b/Source/devtools/front_end/ui/SidebarTreeElement.js
@@ -26,10 +26,11 @@
/**
* @constructor
* @extends {TreeElement}
+ * @param {string} title
*/
-WebInspector.SidebarSectionTreeElement = function(title, hasChildren)
+WebInspector.SidebarSectionTreeElement = function(title)
{
- TreeElement.call(this, title.escapeHTML(), hasChildren);
+ TreeElement.call(this, title.escapeHTML(), true);
this.expand();
}
@@ -76,13 +77,13 @@ WebInspector.SidebarSectionTreeElement.prototype = {
* @param {string} className
* @param {string} title
* @param {string=} subtitle
- * @param {boolean=} hasChildren
+ * @param {boolean=} expandable
*/
-WebInspector.SidebarTreeElement = function(className, title, subtitle, hasChildren)
+WebInspector.SidebarTreeElement = function(className, title, subtitle, expandable)
{
- TreeElement.call(this, "", hasChildren);
+ TreeElement.call(this, "", expandable);
- if (hasChildren)
+ if (expandable)
this.disclosureButton = createElementWithClass("button", "disclosure-button");
this.iconElement = createElementWithClass("div", "icon");
@@ -175,7 +176,7 @@ WebInspector.SidebarTreeElement.prototype = {
if (this.small)
this.listItemElement.classList.add("small");
- if (this.hasChildren && this.disclosureButton)
+ if (this.isExpandable() && this.disclosureButton)
this.listItemElement.appendChild(this.disclosureButton);
this.listItemElement.appendChildren(this.iconElement, this.statusElement, this.titlesElement);

Powered by Google App Engine
This is Rietveld 408576698