-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script -5- Admin Dashboard.js
43 lines (36 loc) · 1.98 KB
/
Script -5- Admin Dashboard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
document.querySelector(".sidenav-create").addEventListener("click", function () {
document.querySelector(".create-options").classList.toggle("show-create-option");
})
Array.from(document.querySelectorAll(".nav-tabs")).forEach(i => {
i.addEventListener("click", function () {
for (let i = 0; i < Array.from(document.querySelectorAll(".nav-tabs")).length; i++) {
if (Array.from(document.querySelectorAll(".nav-tabs"))[i].classList.contains("navTab-Selector")) {
Array.from(document.querySelectorAll(".nav-tabs"))[i].classList.remove("navTab-Selector");
}
}
i.classList.add("navTab-Selector");
})
})
Array.from(document.querySelectorAll(".nav-tabs-icon")).forEach(x => {
x.addEventListener("click", function () {
document.querySelector(".nav-tabs-icon-create").children[0].children[0].children[0].classList.remove("icon-bg")
for (let i = 0; i < Array.from(document.querySelectorAll(".nav-tabs-icon")).length; i++) {
if (document.querySelectorAll(".nav-tabs-icon")[i].children[0].children[0].classList.contains("icon-bg")) {
document.querySelectorAll(".nav-tabs-icon")[i].children[0].children[0].classList.remove("icon-bg")
}
}
x.children[0].children[0].classList.add("icon-bg")
}
)
})
document.querySelector(".nav-tabs-icon-create").addEventListener("click", function () {
for (let i = 0; i < Array.from(document.querySelectorAll(".nav-tabs-icon")).length; i++) {
document.querySelectorAll(".nav-tabs-icon")[i].children[0].children[0].classList.remove("icon-bg")
}
if (document.querySelector(".nav-tabs-icon-create").children[0].children[0].children[0].classList.contains("icon-bg")) {
document.querySelector(".nav-tabs-icon-create").children[0].children[0].children[0].classList.remove("icon-bg")
}
else {
document.querySelector(".nav-tabs-icon-create").children[0].children[0].children[0].classList.add("icon-bg")
}
})