diff --git a/app/js/custom.js b/app/js/custom.js index 400cfe0f..df505046 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -277,7 +277,15 @@ $(window).resize(function() { $('.sidebar').removeClass('d-none'); $('.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) .ajaxSend(setCSRFTokenHeader)