1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Adds active class to current nav-item

This commit is contained in:
billz 2019-10-24 22:23:57 +01:00
parent a126b9c8c2
commit 46da9b91e7

View File

@ -277,7 +277,15 @@ $(window).resize(function() {
$('.sidebar').removeClass('d-none'); $('.sidebar').removeClass('d-none');
$('.sidebar').removeClass('toggled'); $('.sidebar').removeClass('toggled');
}; };
}); });
// Adds active class to current nav-item
$(window).bind("load", function() {
var url = window.location;
$('ul.navbar-nav a').filter(function() {
return this.href == url;
}).parent().addClass('active');
});
$(document) $(document)
.ajaxSend(setCSRFTokenHeader) .ajaxSend(setCSRFTokenHeader)