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

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

Issue 367093003: DevTools: More code reduce via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/ui/SettingsUI.js ('k') | Source/devtools/front_end/ui/SoftContextMenu.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34a126f9fc74bd79b443cc990e78acfa312bc27e..4d986349da9b61c918a86ddd74514a9298656b7d 100644
--- a/Source/devtools/front_end/ui/SidebarTreeElement.js
+++ b/Source/devtools/front_end/ui/SidebarTreeElement.js
@@ -83,10 +83,8 @@ WebInspector.SidebarTreeElement = function(className, title, subtitle, represent
{
TreeElement.call(this, "", representedObject, hasChildren);
- if (hasChildren) {
- this.disclosureButton = document.createElement("button");
- this.disclosureButton.className = "disclosure-button";
- }
+ if (hasChildren)
+ this.disclosureButton = document.createElementWithClass("button", "disclosure-button");
this.iconElement = document.createElementWithClass("div", "icon");
this.statusElement = document.createElementWithClass("div", "status");
@@ -180,9 +178,7 @@ WebInspector.SidebarTreeElement.prototype = {
if (this.hasChildren && this.disclosureButton)
this.listItemElement.appendChild(this.disclosureButton);
- this.listItemElement.appendChild(this.iconElement);
- this.listItemElement.appendChild(this.statusElement);
- this.listItemElement.appendChild(this.titlesElement);
+ this.listItemElement.appendChildren(this.iconElement, this.statusElement, this.titlesElement);
},
onreveal: function()
« no previous file with comments | « Source/devtools/front_end/ui/SettingsUI.js ('k') | Source/devtools/front_end/ui/SoftContextMenu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698