Less buggy menu selection
This commit is contained in:
@@ -373,6 +373,8 @@ handlePathChange(Wt::WStackedWidget& stack, bool isAdmin)
|
|||||||
|
|
||||||
LMS_LOG(UI, DEBUG) << "Internal path changed to '" << wApp->internalPath() << "'";
|
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)
|
for (const auto& view : views)
|
||||||
{
|
{
|
||||||
if (wApp->internalPathMatches(view.path))
|
if (wApp->internalPathMatches(view.path))
|
||||||
@@ -437,11 +439,6 @@ LmsApplication::createHome()
|
|||||||
|
|
||||||
declareJavaScriptFunction("onLoadCover", "function(id) { id.className += \" Lms-cover-loaded\"}");
|
declareJavaScriptFunction("onLoadCover", "function(id) { id.className += \" Lms-cover-loaded\"}");
|
||||||
doJavaScript("$('body').tooltip({ selector: '[data-toggle=\"tooltip\"]'})");
|
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")))};
|
Wt::WTemplate* main {root()->addWidget(std::make_unique<Wt::WTemplate>(Wt::WString::tr("Lms.template")))};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user