Search code examples
asp.net-core-2.1aspnetboilerplate

Multi level menu item does stay expanded when a sub menu is selected


I have an ASP Boilerplate project and I want to use multi level menus but when a sub menu selected and page is fully loaded, top menu must stay expanded but it collapse.Menu bar must look like this not this when I select Tenants for example (Management menu must remain expanded).


Solution

  • Fixed in v4.0 of the template.

    You can add the following code in admin.js after line var $activeAnchors = $(val).find('a:eq(0)');

    var $parentAnchors = $(val).parentsUntil('.menu .list', 'li').children('a:first-child');
    $activeAnchors = $activeAnchors.add($parentAnchors);
    

    #292 (comment)