Initial commit - existing project files
This commit is contained in:
commit
c49798a9ea
82 changed files with 4304 additions and 0 deletions
42
static/js/statistics.js
Normal file
42
static/js/statistics.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue