diff --git a/approot/templates.xml b/approot/templates.xml
index 942a0770..5be1e07d 100644
--- a/approot/templates.xml
+++ b/approot/templates.xml
@@ -18,10 +18,10 @@
- - ${artists class="Lms-btn"}
- - ${releases class="Lms-btn"}
- - ${tracks class="Lms-btn"}
- - ${playqueue class="Lms-btn"}
+ - ${artists class="Lms-btn"}
+ - ${releases class="Lms-btn"}
+ - ${tracks class="Lms-btn"}
+ - ${playqueue class="Lms-btn"}
${filters class="form-group Lms-clusters-control"}
diff --git a/src/lms/ui/LmsApplication.cpp b/src/lms/ui/LmsApplication.cpp
index 7327b061..a4381457 100644
--- a/src/lms/ui/LmsApplication.cpp
+++ b/src/lms/ui/LmsApplication.cpp
@@ -349,7 +349,7 @@ enum IdxRoot
static
void
-handlePathChange(Wt::WTemplate& main, Wt::WStackedWidget& stack, bool isAdmin)
+handlePathChange(Wt::WStackedWidget& stack, bool isAdmin)
{
static const struct
{
@@ -373,11 +373,6 @@ handlePathChange(Wt::WTemplate& main, Wt::WStackedWidget& stack, bool isAdmin)
LMS_LOG(UI, DEBUG) << "Internal path changed to '" << wApp->internalPath() << "'";
- main.bindString("artists-active", wApp->internalPathMatches("/artists") ? "active" : "");
- main.bindString("releases-active", wApp->internalPathMatches("/releases") ? "active" : "");
- main.bindString("tracks-active", wApp->internalPathMatches("/tracks") ? "active" : "");
- main.bindString("playqueue-active", wApp->internalPathMatches("/playqueue") ? "active" : "");
-
for (const auto& view : views)
{
if (wApp->internalPathMatches(view.path))
@@ -442,6 +437,11 @@ 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")))};
@@ -603,10 +603,10 @@ LmsApplication::createHome()
internalPathChanged().connect([=]
{
- handlePathChange(*main, *mainStack, isUserAdmin());
+ handlePathChange(*mainStack, isUserAdmin());
});
- handlePathChange(*main, *mainStack, isUserAdmin());
+ handlePathChange(*mainStack, isUserAdmin());
}
void