Wrap layer selection in labels so clicking text checks box
This commit is contained in:
parent
bacab31bbc
commit
4167fed59c
1 changed files with 1 additions and 1 deletions
2
main.js
2
main.js
|
|
@ -32,7 +32,7 @@ for (let category of layerCategories) {
|
|||
for (let layer of category.layers) {
|
||||
const li = document.createElement("li");
|
||||
li.innerHTML = `
|
||||
<input type="checkbox" ${layer.enabled ? "checked" : ""}> ${layer.name}
|
||||
<label><input type="checkbox" ${layer.enabled ? "checked" : ""}> ${layer.name}</label>
|
||||
`;
|
||||
li.querySelector("input").addEventListener("change", function(e){
|
||||
if (e.target.checked) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue