| 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
|
| });
|
|
|
|
|