1(function ($) { 2 window.addEventListener('load', (e) => { 3 const $utilityMenu = $('.utility-menu .menu-item:not(.wpml-ls-item):not(.menu-item__search)').clone(true); 4 const $utilityWrapper = $('<div class="utility-wrapper">'); 5 const $utilityWrapperInner = $('<div class="utility-wrapper__inner" role="list"></div>'); 6 // The wrapper is a child of the navigation ul, so it has to be a list item 7 // for the list to stay a list. display: contents keeps the wrapper itself 8 // as the laid-out box, the same way the logo item is inserted in header.js. 9 const $utilityWrapperItem = $('<li class="utility-wrapper-item"></li>').css('display', 'contents'); 10 $utilityWrapperInner.append($utilityMenu); 11 $utilityWrapper.append($utilityWrapperInner); 12 $utilityWrapperItem.append($utilityWrapper); 13 $utilityMenu.addClass('utility-link'); 14 $utilityWrapperItem.insertBefore($('#mega-menu-max_mega_menu_1 > li.mega-menu-item:last-of-type')); 15 16 $("ul.max-mega-menu").on("after_mega_menu_init", function (element) { 17 var menu = jQuery(this); 18 19 $("li.mega-menu-item.mega-menu-item-has-children > a.mega-menu-link > span.mega-indicator").on('click', function (e) { 20 const $currentParent = $(e.target).closest('li.mega-menu-item.mega-menu-item-has-children'); 21 const levelSiblings = $currentParent.siblings('li.mega-menu-item.mega-menu-item-has-children.mega-toggle-on'); 22 23 levelSiblings.each(function (index, element) { 24 const $currentLevelElement = $('> a.mega-menu-link', $(element)); 25 const nestedElements = $('li.mega-menu-item.mega-menu-item-has-children.mega-toggle-on > a.mega-menu-link', $(element)); 26 menu.data('maxmegamenu').hidePanel($currentLevelElement, true) 27 28 nestedElements.each(function (index, nestedElement) { 29 menu.data('maxmegamenu').hidePanel($(nestedElement), true); 30 }); 31 }); 32 33 }); 34 }); 35 }); 36})(jQuery);
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.