diff --git a/src/lms/ui/LmsApplication.cpp b/src/lms/ui/LmsApplication.cpp index a4381457..fa13599b 100644 --- a/src/lms/ui/LmsApplication.cpp +++ b/src/lms/ui/LmsApplication.cpp @@ -373,6 +373,8 @@ handlePathChange(Wt::WStackedWidget& stack, bool isAdmin) LMS_LOG(UI, DEBUG) << "Internal path changed to '" << wApp->internalPath() << "'"; + LmsApp->doJavaScript(R"($('.navbar-nav li.active').removeClass('active'); $('.navbar-nav a[href="' + location.pathname + '"]').closest('li').addClass('active');)"); + for (const auto& view : views) { if (wApp->internalPathMatches(view.path)) @@ -437,11 +439,6 @@ LmsApplication::createHome() declareJavaScriptFunction("onLoadCover", "function(id) { id.className += \" Lms-cover-loaded\"}"); doJavaScript("$('body').tooltip({ selector: '[data-toggle=\"tooltip\"]'})"); - doJavaScript(R"( -$(".navbar-nav a").on("click", function(){ - $(".navbar-nav").find(".active").removeClass("active"); - $(this).parent().addClass("active"); -});)"); Wt::WTemplate* main {root()->addWidget(std::make_unique(Wt::WString::tr("Lms.template")))};