Rearranged statistics page

This commit is contained in:
W13R 2022-05-24 20:49:18 +02:00
parent 95d37dbc3d
commit 9f965b8119
3 changed files with 8 additions and 86 deletions

View file

@ -1,42 +0,0 @@
{
let statistics_dropdown_choices;
let statistics_tables;
let dropDownMenuActive = false;
document.addEventListener("DOMContentLoaded", () => {
// elements
let statistics_dropdown_menu = document.getElementById("statisticsDropDownMenu");
let statistics_dropdown_menu_button = document.getElementById("statisticsDropDownMenuButton");
statistics_dropdown_choices = [...statistics_dropdown_menu.getElementsByClassName("sChoice")];
statistics_tables = [...document.getElementsByClassName("statisticsTable")];
statistics_dropdown_menu_button.addEventListener("click", () => {
if (statistics_dropdown_menu.classList.contains("dropDownVisible")) {
statistics_dropdown_menu.classList.remove("dropDownVisible");
}
else {
statistics_dropdown_menu.classList.add("dropDownVisible");
}
})
statistics_dropdown_choices.forEach(element => {
element.addEventListener("click", () => {
changeStatisticsChoice(element.innerText, element.dataset.statistics_div);
})
})
})
function changeStatisticsChoice(choice_name, div_id) {
statistics_tables.forEach(element => {
element.classList.add("nodisplay");
})
document.getElementById(div_id).classList.remove("nodisplay");
}
}