We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d435ce1 commit f5117deCopy full SHA for f5117de
script/script.js
@@ -1,15 +1,9 @@
1
const NAVBAR_LI_ELEMENTS = document.getElementById('navbar').firstElementChild.children; // Access all the <li> in side navigation
2
-let flag = false;
3
-
4
5
// check for a match with the <li> element and SITE_URL, then make it active
6
Array.from(NAVBAR_LI_ELEMENTS).forEach((liElement) => {
7
if (liElement.firstElementChild.href == location.href) {
8
liElement.classList.add('active');
9
- flag = true;
10
return;
11
}
12
-})
13
14
-// if no other tab is active, then the Home tab becomes active
15
-if (!flag) NAVBAR_LI_ELEMENTS[0].classList.add('active');
+})
0 commit comments