Skip to content

Commit f5117de

Browse files
modified: script/script.js
1 parent d435ce1 commit f5117de

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

script/script.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
const NAVBAR_LI_ELEMENTS = document.getElementById('navbar').firstElementChild.children; // Access all the <li> in side navigation
2-
let flag = false;
3-
42

53
// check for a match with the <li> element and SITE_URL, then make it active
64
Array.from(NAVBAR_LI_ELEMENTS).forEach((liElement) => {
75
if (liElement.firstElementChild.href == location.href) {
86
liElement.classList.add('active');
9-
flag = true;
107
return;
118
}
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');
9+
})

0 commit comments

Comments
 (0)