comments
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-11-01 15:40:25 +01:00
parent fcc146842c
commit fe9a0c750b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -14,6 +14,8 @@ const buildFileTree = (parent, data, location) => {
// Directory
li.textContent = item.name;
li.classList.add("collapsed");
// Toggle collapsing on click
li.addEventListener("click", function (e) {
if (e.target === li) {
li.classList.toggle("collapsed");
@ -43,6 +45,7 @@ const buildFileTree = (parent, data, location) => {
};
window.addEventListener("load", () => {
// Build the filetree
const fileTreeElement = document.getElementsByTagName("aside")[0];
const dataElement = fileTreeElement.getElementsByTagName("span")[0];
@ -51,6 +54,5 @@ window.addEventListener("load", () => {
JSON.parse(dataElement.getAttribute("data-json")).children,
""
);
dataElement.remove();
});