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

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

Issue 1164763004: DevTools: render category filters in a way that they don't clash. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for landing Created 5 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/SearchableView.js ('k') | Source/devtools/front_end/ui/checkboxTextLabel.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 7866ee032a08ff6abd4028390196a40e4cdf6b91..22baf783e68e340fb0954e44a65888d02de54f23 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -1334,12 +1334,46 @@ function createCheckboxLabel(title, checked)
{
var root = WebInspector.createShadowRootWithCoreStyles(this);
root.appendChild(WebInspector.Widget.createStyleElement("ui/checkboxTextLabel.css"));
- this.checkboxElement = this.createChild("input", "dt-checkbox-button");
- this.checkboxElement.type = "checkbox";
- root.createChild("content").select = ".dt-checkbox-button";
+ var checkboxElement = createElementWithClass("input", "dt-checkbox-button");
+ checkboxElement.type = "checkbox";
+ root.appendChild(checkboxElement);
+ this.checkboxElement = checkboxElement;
+
+ this.addEventListener("click", toggleCheckbox.bind(this));
+
+ /**
+ * @param {!Event} event
+ * @this {Node}
+ */
+ function toggleCheckbox(event)
+ {
+ if (event.target !== checkboxElement && event.target !== this)
+ checkboxElement.click();
+ }
+
root.createChild("content");
},
+ /**
+ * @param {string} color
+ * @this {Element}
+ */
+ set backgroundColor(color)
+ {
+ this.checkboxElement.classList.add("dt-checkbox-colored");
+ this.checkboxElement.style.backgroundColor = color;
+ },
+
+ /**
+ * @param {string} color
+ * @this {Element}
+ */
+ set borderColor(color)
+ {
+ this.checkboxElement.classList.add("dt-checkbox-colored");
+ this.checkboxElement.style.borderColor = color;
+ },
+
__proto__: HTMLLabelElement.prototype
});
« no previous file with comments | « Source/devtools/front_end/ui/SearchableView.js ('k') | Source/devtools/front_end/ui/checkboxTextLabel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698