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

Unified Diff: Source/devtools/front_end/audits/AuditLauncherView.js

Issue 805853002: DevTools: Make labeled checkbox a web component (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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/devtools.gypi ('k') | Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/audits/AuditLauncherView.js
diff --git a/Source/devtools/front_end/audits/AuditLauncherView.js b/Source/devtools/front_end/audits/AuditLauncherView.js
index 80caca156fb715a0c8aa6abb6f25178f497191c2..c3cc19a93f92faf17dba3878996d7e79538210bf 100644
--- a/Source/devtools/front_end/audits/AuditLauncherView.js
+++ b/Source/devtools/front_end/audits/AuditLauncherView.js
@@ -107,7 +107,7 @@ WebInspector.AuditLauncherView.prototype = {
var selectedCategories = this._selectedCategoriesSetting.get();
var categoryElement = this._createCategoryElement(category.displayName, category.id);
- category._checkboxElement = categoryElement.firstChild;
+ category._checkboxElement = categoryElement.checkboxElement;
if (this._selectAllCheckboxElement.checked || selectedCategories[category.displayName]) {
category._checkboxElement.checked = true;
++this._currentCategoriesCount;
@@ -221,19 +221,15 @@ WebInspector.AuditLauncherView.prototype = {
/**
* @param {string} title
- * @param {string} id
+ * @param {string=} id
*/
_createCategoryElement: function(title, id)
{
- var labelElement = createElement("label");
- labelElement.id = this._categoryIdPrefix + id;
-
- var element = createElement("input");
- element.type = "checkbox";
- if (id !== "")
- element.addEventListener("click", this._boundCategoryClickListener, false);
- labelElement.appendChild(element);
- labelElement.createTextChild(title);
+ var labelElement = createCheckboxLabel(title);
+ if (id) {
+ labelElement.id = this._categoryIdPrefix + id;
+ labelElement.checkboxElement.addEventListener("click", this._boundCategoryClickListener, false);
+ }
labelElement.__displayName = title;
return labelElement;
@@ -259,7 +255,7 @@ WebInspector.AuditLauncherView.prototype = {
}
var categoryElement = this._createCategoryElement(WebInspector.UIString("Select All"), "");
categoryElement.id = "audit-launcher-selectall";
- this._selectAllCheckboxElement = categoryElement.firstChild;
+ this._selectAllCheckboxElement = categoryElement.checkboxElement;
this._selectAllCheckboxElement.checked = this._selectedCategoriesSetting.get()[WebInspector.AuditLauncherView.AllCategoriesKey];
this._selectAllCheckboxElement.addEventListener("click", handleSelectAllClick.bind(this), false);
this._contentElement.appendChild(categoryElement);
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698