1jQuery(function($) { 2 3 // Disabnle the link on parent menu items on mobile 4 if ($(window).width() <= 772) { 5 $('.gw-mm-item.has-children .gw-mm-item__link a').on('click', function(e) { 6 e.preventDefault(); 7 $(this).siblings('.gw-mm-item__toggle').trigger('click'); 8 }); 9 10 // get the element 11 var element = document.querySelector(".wp-block-getwid-megamenu"); 12 13 // initiate MutationObserver 14 var observer = new MutationObserver(function(mutations) { 15 mutations.forEach(function(mutation) { 16 if (mutation.attributeName === "class") { 17 var addedClasses = mutation.target.classList; 18 if (Array.from(addedClasses).includes('is-opened')) { 19 $('header .wp-container-5').addClass('menu-is-opened'); 20 } else { 21 $('header .wp-container-5').removeClass('menu-is-opened'); 22 } 23 } 24 }); 25 }); 26 27 // config the observer 28 observer.observe(element, { 29 attributes: true, 30 attributeFilter: ['class'] 31 }); 32 } 33 34});
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.