Fixed 'active' menu item class sometimes badly applied

This commit is contained in:
emeric
2023-01-21 11:36:45 +01:00
parent f8869694db
commit 68ef0567fd
+1 -1
View File
@@ -401,7 +401,7 @@ LmsApplication::createHome()
R"(function(current) {
const menuItems = document.querySelectorAll('.nav-item a[href]:not([href=""])');
for (const menuItem of menuItems) {
if (menuItem.getAttribute("href").indexOf(current) !== -1) {
if (menuItem.getAttribute("href") === current) {
menuItem.classList.add('active');
}
else {