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:
2023-03-15 13:26:37 +01:00
parent 8f6047bb9f
commit 09409dc698
4 changed files with 80 additions and 18 deletions

View File

@@ -1,6 +1,4 @@
$(document).ready( function() {
document.getElementsByName("iframe")[0].src =
window.location.protocol + "//" + window.location.hostname + ":8097";
document.getElementById("rest-mock").href =
window.location.protocol + "//" + window.location.hostname + ":8097";
console.log("DONE")

View 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")
}
}
}