ui: Make Checkbox label click trigger checkbox toggle

This commit is contained in:
Jens Langhammer 2020-07-01 12:37:13 +02:00
parent 0e6561987e
commit ec6f467fa2

View file

@ -22,6 +22,14 @@ document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((b) => {
}); });
}); });
// Make Checkbox label click trigger checkbox toggle
document.querySelectorAll(".pf-c-check__label").forEach((checkLabel) => {
checkLabel.addEventListener("click", (e) => {
const checkbox = e.target.parentElement.querySelector("input[type=checkbox]");
checkbox.checked = !checkbox.checked;
});
});
// CodeMirror // CodeMirror
document.querySelectorAll(".codemirror").forEach((cm) => { document.querySelectorAll(".codemirror").forEach((cm) => {
let cmMode = 'xml'; let cmMode = 'xml';