Personnel filtering
This commit is contained in:
17
static/js/personnel.js
Normal file
17
static/js/personnel.js
Normal file
@ -0,0 +1,17 @@
|
||||
let people = Array.from(document.getElementsByClassName("person"));
|
||||
let buttons = Array.from(document.getElementsByClassName("button"));
|
||||
|
||||
buttons.forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
buttons.forEach(button => {
|
||||
button.classList.remove("active");
|
||||
});
|
||||
button.classList.add("active");
|
||||
people.forEach(person => {
|
||||
person.classList.remove("hidden");
|
||||
if (button.dataset.value != 0 && !person.dataset.beh.includes(button.dataset.value)) {
|
||||
person.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user