Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
SOD/public/javascripts/orders.js

17 lines
542 B
JavaScript

const date = document.getElementById("date");
document.querySelectorAll("h4").forEach((e) => {
e.addEventListener("click", ev => {
ev.stopPropagation();
let action;
if (e.classList.contains("collapsed"))
action = "remove";
else
action = "add";
e.parentElement.querySelectorAll(".collection").forEach(c => c.classList[action]("hide"));
e.classList[action]("collapsed");
})
});
date.addEventListener("change", () => window.location.href = "?date="+date.value);