File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed
Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 77 >
88 { foreach from= $nodes item= node}
99 <li
10- class =" { $node .type} { if $node .current} current{ /if } { if $depth === 0} main-menu__tree__item d-flex align-items-center h-100{ /if } "
10+ class =" { $node .type} { if $node .current} current{ /if } { if $depth === 0} js-menu-item-lvl-0 main-menu__tree__item d-flex align-items-center h-100{ /if } "
1111 id =" { $node .page_identifier} "
1212 >
1313 { if $depth > 1 && $node .children|count}
105105{ /function}
106106
107107<div class =" main-menu col-xl col-auto d-flex align-items-center" >
108- <div class =" d-none d-xl-block position-static js-menu-desktop h-100 " >
108+ <div class =" d-none d-xl-block position-static js-menu-desktop" >
109109 { desktopMenu nodes= $menu .children}
110110 </div >
111111
Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ export const visiblePassword = {
117117export const desktopMenu = {
118118 dropdownToggles : '.js-menu-desktop .dropdown .dropdown-toggle[data-depth]' ,
119119 dropdownItemAnchor : ( depth : number ) => `.js-menu-desktop a[data-depth="${ depth } "]` ,
120+ menuItemsLvl0 : '.js-menu-item-lvl-0' ,
121+ subMenu : '.js-sub-menu' ,
120122} ;
121123
122124export const qtyInput = {
Original file line number Diff line number Diff line change @@ -15,6 +15,21 @@ const initDesktopMenu = () => {
1515 const { Theme} = window ;
1616 const { desktopMenu : desktopMenuMap } = Theme . selectors ;
1717
18+ /**
19+ * Handle submenu position
20+ */
21+ const menuItemsLvl0 = document . querySelectorAll ( desktopMenuMap . menuItemsLvl0 ) ;
22+
23+ if ( menuItemsLvl0 ) {
24+ menuItemsLvl0 . forEach ( ( element : HTMLElement ) => {
25+ element . addEventListener ( 'mouseenter' , ( ) => {
26+ const subMenuTopPosition = element . offsetHeight + element . offsetTop ;
27+ const subMenu = element . querySelector ( desktopMenuMap . subMenu ) as HTMLElement ;
28+ subMenu . style . top = `${ subMenuTopPosition } px` ;
29+ } ) ;
30+ } ) ;
31+ }
32+
1833 /**
1934 * Handle Mouse and Keyboard events for Submenus.
2035 * Find all dropdown toggles with [data-depth: ^2]
Original file line number Diff line number Diff line change 66 }
77
88 & __tree {
9+ flex-wrap : wrap ;
10+
911 > li {
1012 > a {
1113 padding : 1.5rem 1rem ;
2527 left : 0 ;
2628 z-index : $zindex-offcanvas ;
2729 display : none ;
28- padding : 0.725rem 0 ;
29- background-color : #fff ;
30+ padding : 1rem 0 ;
31+ background-color : var (--bs-white );
32+ border-top : 1px solid var (--bs-gray-200 );
3033
3134 & .focusing ,
3235 & :focus-within {
You can’t perform that action at this time.
0 commit comments