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

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

Issue 362273002: DevTools: Reduce code 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/sources/SourcesView.js ('k') | Source/devtools/front_end/ui/Popover.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/Checkbox.js
diff --git a/Source/devtools/front_end/ui/Checkbox.js b/Source/devtools/front_end/ui/Checkbox.js
index 7802c0954907f2dfb3c515113c85a43cd6d8fadc..07a9fd7d16e20d38833f1dca3ab2c4df64953a1e 100644
--- a/Source/devtools/front_end/ui/Checkbox.js
+++ b/Source/devtools/front_end/ui/Checkbox.js
@@ -31,13 +31,10 @@
*/
WebInspector.Checkbox = function(label, className, tooltip)
{
- this.element = document.createElement('label');
- this._inputElement = document.createElement('input');
+ this.element = document.createElementWithClass("label", className);
+ this._inputElement = this.element.createChild("input");
this._inputElement.type = "checkbox";
-
- this.element.className = className;
- this.element.appendChild(this._inputElement);
- this.element.appendChild(document.createTextNode(label));
+ this.element.createTextChild(label);
if (tooltip)
this.element.title = tooltip;
}
« no previous file with comments | « Source/devtools/front_end/sources/SourcesView.js ('k') | Source/devtools/front_end/ui/Popover.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698