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

18 lines
542 B
JavaScript
Raw Permalink Normal View History

2020-08-16 12:48:43 +02:00
const date = document.getElementById("date");
2020-09-28 15:08:58 +02:00
document.querySelectorAll("h4").forEach((e) => {
2020-08-16 12:48:43 +02:00
e.addEventListener("click", ev => {
ev.stopPropagation();
let action;
2020-09-28 15:08:58 +02:00
if (e.classList.contains("collapsed"))
2020-08-16 12:48:43 +02:00
action = "remove";
else
action = "add";
2020-09-28 15:08:58 +02:00
e.parentElement.querySelectorAll(".collection").forEach(c => c.classList[action]("hide"));
e.classList[action]("collapsed");
2020-08-16 12:48:43 +02:00
})
2020-09-28 15:08:58 +02:00
});
2020-08-16 12:48:43 +02:00
date.addEventListener("change", () => window.location.href = "?date="+date.value);