Remove element ids from the layersView in the sidebar

Similar to other recent patches, see e.g. PR 15057, we don't want to add these kind of `id`s to DOM-elements since they shouldn't become "linkable" through the URL hash.

*Please note:* This patch can be tested, in the viewer, with e.g. `bug1737260.pdf` from the test-suite.
This commit is contained in:
Jonas Jenwald 2022-06-24 20:12:50 +02:00
parent cd35b9bfac
commit 9748d3eb85
2 changed files with 7 additions and 4 deletions

View File

@ -153,14 +153,13 @@ class PDFLayerViewer extends BaseTreeViewer {
const input = document.createElement("input");
this._bindLink(element, { groupId, input });
input.type = "checkbox";
input.id = groupId;
input.checked = group.visible;
const label = document.createElement("label");
label.setAttribute("for", groupId);
label.textContent = this._normalizeTextContent(group.name);
element.append(input, label);
label.append(input);
element.append(label);
layersCount++;
}

View File

@ -1156,12 +1156,16 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
cursor: pointer;
}
#layersView .treeItem > a > * {
#layersView .treeItem > a * {
cursor: pointer;
}
#layersView .treeItem > a > label {
padding-inline-start: 4px;
}
#layersView .treeItem > a > label > input {
float: inline-start;
margin-top: 1px;
}
.treeItemToggler {
position: relative;