Less buggy menu selection

This commit is contained in:
emeric
2020-09-04 23:46:05 +02:00
parent a0eec113e1
commit 5dad7f9211
+2 -5
View File
@@ -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::WTemplate>(Wt::WString::tr("Lms.template")))};