1(function ($, Drupal) { 2 3 4 5 6 7 (Drupal => { 8 function initSubmenu(el) { 9 el.addEventListener('click', toggleSubmenu); 10 11 if (el.dataset.ariacontrols) { 12 el.setAttribute('aria-controls', el.dataset.ariacontrols); 13 } 14 el.setAttribute('aria-expanded', 'false'); 15 16 let actTrail = $('#block-glownanawigacja li.menu__item--active-trail'); 17 actTrail.children('button').each(function () { 18 $(this).attr('aria-expanded', 'true'); 19 }) 20 } 21 22 function toggleSubmenu(e) { 23 const button = e.currentTarget; 24 let level = $(button).data('level') 25 26 $('button[data-level=' + level + ']').not(this).attr('aria-expanded', 'false'); 27 28 const currentState = button.getAttribute('aria-expanded') === 'true'; 29 button.setAttribute('aria-expanded', !currentState); 30 } 31 32 $(document).on('click', function (e) { 33 34 if (!(($(e.target).closest(".menu--main").length > 0) || ($(e.target).closest(".menu--main").length > 0))) { 35 $('#block-glownanawigacja-2 button.menu__link--button').attr('aria-expanded', 'false'); 36 } 37 }); 38 39 40 Drupal.behaviors.submenu = { 41 attach(context) { 42 context.querySelectorAll('.menu__link--button').forEach(el => initSubmenu(el)); 43 }, 44 }; 45 })(Drupal); 46 47 48 let actTrail = $('#block-glownanawigacja li.menu__item--active-trail'); 49 50 actTrail.children('button').each(function () { 51 $(this).attr('aria-expanded', 'true'); 52 }) 53 54 55 $('.menu-burger').click(function () { 56 $(this).toggleClass('open'); 57 $(this).attr('aria-expanded', $(this).attr('aria-expanded') == 'false' ? 'true' : 'false'); 58 $(this).prev().toggleClass('open'); 59 }); 60 61 62})(jQuery, Drupal);
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.