remove old spoiler js

This commit is contained in:
f0x 2023-05-10 20:18:50 +02:00
parent df3ad1e06e
commit 61cb484be9

View file

@ -45,22 +45,6 @@ new PhotoswipeVideoPlugin(lightbox, {});
lightbox.init();
Array.from(document.getElementsByClassName("spoiler-label")).forEach((label) => {
let checkbox = document.getElementById(label.htmlFor);
if (checkbox != undefined) {
function update() {
if (checkbox.checked) {
label.innerHTML = "Show more";
} else {
label.innerHTML = "Show less";
}
}
update();
label.addEventListener("click", () => { setTimeout(update, 1); });
}
});
Array.from(document.getElementsByClassName("spoiler-details")).forEach((spoiler) => {
const button = spoiler.getElementsByClassName("button")[0];
@ -76,4 +60,4 @@ Array.from(document.getElementsByClassName("spoiler-details")).forEach((spoiler)
spoiler.addEventListener("toggle", update);
}
});
});