husstanden/static/js/interact.js

25 lines
634 B
JavaScript
Raw Normal View History

2019-04-25 22:13:44 +02:00
function openCategory(DOM) {
DOM.parentNode.children[1].classList.remove("hidden");
}
function closeCategory(DOM) {
DOM.parentNode.children[1].classList.add("hidden");
}
function toggleCategory(DOM) {
let classes = DOM.parentNode.children[1].classList;
classes[classes.contains("hidden") ? "remove" : "add"]("hidden");
}
/*
function postPageLoad() {
let ent = document.getElementById("sidenav").children[1].children[0].children[0].children;
for (let i = 0; i < ent.length; i++) {
if (!ent[i].children[0].classList.contains("item"))
continue;
ent[i].children[0].onclick = toggleCategory(ent[i].children[0]);
}
}
*/