diff --git a/extensions/odoo_theme/static/js/menu.js b/extensions/odoo_theme/static/js/menu.js index fa6af0b59..9276acfb5 100644 --- a/extensions/odoo_theme/static/js/menu.js +++ b/extensions/odoo_theme/static/js/menu.js @@ -9,13 +9,16 @@ // Allow to respectively highlight and expand the TOC entries and their related TOC entry // list whose page is displayed. - _flagActiveTocEntriesAndLists(navigationMenu); + const deepestActiveTocEntries = _flagActiveTocEntriesAndLists(navigationMenu); - // Expand the top-level menu items on the homepage. + // Expand the top-level menu items. _expandTopMenus(navigationMenu); // Show hidden menu when the css classes have been properly specified navigationMenu.removeAttribute('hidden'); + + // Scroll the menu to the deepest active TOC entry. + _scrollToDeepestActiveTocEntry(deepestActiveTocEntries); }); /** @@ -23,17 +26,18 @@ * * TOC entries (
  • elements) that are on the path of the displayed page receive the * `o_active_toc_entry` class, and their related (parent) TOC entry list (