Added category menu (#117)
Co-authored-by: Adam Bem <adam.bem@zoho.eu> Reviewed-on: R11/release11-tools-web#117
This commit is contained in:
23
Frontend/assets/scripts/frame.js
Normal file
23
Frontend/assets/scripts/frame.js
Normal file
@@ -0,0 +1,23 @@
|
||||
function changeActiveTools(activeClass, activeCategoryButton) {
|
||||
let tools = document.getElementById("toolList").children
|
||||
|
||||
for (i = 0; i < tools.length; i++) {
|
||||
if (tools[i].classList.contains(activeClass)) {
|
||||
tools[i].style.display = "block";
|
||||
}
|
||||
else {
|
||||
tools[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
let categories = document.getElementById("menu").children
|
||||
|
||||
for (i = 0; i < categories.length; i++) {
|
||||
if (categories[i].innerText == activeCategoryButton) {
|
||||
categories[i].classList.add("active")
|
||||
}
|
||||
else {
|
||||
categories[i].classList.remove("active")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user