1$(document).ready(function () { 2 const { sendEvent } = AnalyticsHelpers; 3 4 // ===== Mobile submenu open ===== 5 // Bound unconditionally on purpose. This opens the drawer's submenu, and the 6 // drawer is shown by breakpoint rather than by device, so a narrow desktop 7 // window needs it too. It used to sit behind `if (isMobileOrTablet)` - the 8 // function itself, never called, so always truthy: the handler has in fact 9 // always been bound, and gating it on isMobileOrTablet() would have broken 10 // the drawer on a narrowed desktop window. `.open` only carries styles under 11 // #mob_menu, so binding it on the desktop header does nothing. 12 $('.navigation_item.has_sub_menu').on('click', function () { 13 $(this).children('.sub_menu_wrapper').addClass('open'); 14 }); 15 16 // The staggered fade on .sub_item_wrapper was removed. It wrote inline 17 // `opacity: 0; translateY(10px)` to every sub item on load - the drawer's 18 // included - and only mouseenter put them back. A touch device has no hover, 19 // so the drawer submenu opened with all of its items still at opacity 0 and 20 // looked empty. Nothing in CSS sets their opacity, so with the inline styles 21 // gone the items are simply visible, and the wrapper's own hover (desktop) 22 // and .open (drawer) rules control the reveal. 23 24 // ===== Overlay blur logic ===== 25 const $overlay = $('.overlay_blur'); 26 const $nav = $('.nav_holder'); 27 const $items = $nav.find('.navigation_item'); 28 29 $items.on('mouseenter', function () { 30 const $item = $(this); 31 if ($item.hasClass('has_sub_menu')) { 32 $overlay.addClass('show'); 33 } else { 34 $overlay.removeClass('show'); 35 } 36 }); 37 38 $nav.on('mouseleave', function () { 39 $overlay.removeClass('show'); 40 }); 41 42 // ===== Burger / mobile menu ===== 43 $('.burger').on('click', function () { 44 $(this).toggleClass('open'); 45 $('#mob_menu').toggleClass('open'); 46 if ($(this).hasClass('open')) { 47 $('html, body').addClass('freeze'); 48 } else { 49 $('html, body').removeClass('freeze'); 50 } 51 }); 52 53 $('.back').on('click', function (e) { 54 e.stopPropagation(); 55 $(this).parent('.sub_menu_wrapper').removeClass('open'); 56 }); 57 58 // ===== Nav click tracking ===== 59 $('.nav_holder > ul li a').on('click', function (e) { 60 e.preventDefault(); 61 const $link = $(this); 62 const href = $link.attr('href'); 63 let label = $link.text().trim(); 64 65 if ($link.children().find('.sub_item_title').length > 0) { 66 label = $link.children().find('.sub_item_title strong').text().trim(); 67 } 68 69 sendEvent('fn_navigation_click', { label }); 70 window.open(href, '_self'); 71 }); 72});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.