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

26 lines
730 B
JavaScript
Raw Normal View History

2020-08-16 12:48:43 +02:00
const date = document.getElementById("date");
function collapse(e, subDiv) {
e.addEventListener("click", ev => {
ev.stopPropagation();
let action;
if (e.classList.contains("collapse"))
action = "remove";
else
action = "add";
e.querySelectorAll("."+subDiv).forEach(e => e.classList[action]("hide"));
e.classList[action]("collapse");
})
}
document.querySelectorAll(".department").forEach(e => collapse(e, "user"));
document.querySelectorAll(".user").forEach(e => collapse(e, "order"));
2020-08-18 15:49:58 +02:00
document.querySelectorAll(".order").forEach(e => collapse(e, "sandwich"));
2020-08-16 12:48:43 +02:00
date.addEventListener("change", () => window.location.href = "?date="+date.value);