gurayyarar / AdminBSBMaterialDesign

AdminBSB - Free admin panel that is based on Bootstrap 3.x with Material Design
https://gurayyarar.github.io/AdminBSBMaterialDesign
MIT License
2.74k stars 1.56k forks source link

The root menu item is not expanded when the submenu is active #138

Closed XelaNimed closed 6 years ago

XelaNimed commented 6 years ago

Hello. I'm using the ASP.Net Core MVC project with jQuery. In the view, the ViewBag.CurrentPageName is set to the current page value and the item is marked as active in the menu. But if you put the menu on a lower level, then the menu containing it does not open when the page is loaded. At the moment I solved this problem with a small jQuery snippet, which is executed when the page loads:

$("#leftsidebar")
.find("ul.list")
.find("li").has("li.active")
.children("a.menu-toggle").click();

, but can there be a more elegant solution?