1jQuery("body").ready(function () { 2 var fastVisibleOrNo=0; 3 jQuery("#s-button-menu").on('click',function() { 4 if (jQuery("#site-navigation").is(':hidden')) { 5 fastVisibleOrNo=1; 6 jQuery("#site-navigation").css("display","flex"); 7 } else { 8 fastVisibleOrNo=0; 9 } 10 setTimeout(function(){ 11 if (fastVisibleOrNo) { 12 jQuery("#site-navigation").show(400); 13 if ( jQuery( window ).width() <= 800 ) { 14 const focusableElements = 15 'button, #s-button-menu, [href], [tabindex]:not([tabindex="-1"])'; 16 const modal = document.querySelector('#site-navigation'); // select the modal by it's id 17 const modal_1 = document.querySelector('#s-button-menu'); // select the modal by it's id 18 const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal 19 const focusableContent = modal.querySelectorAll(focusableElements); 20 const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal 21 document.addEventListener('keydown', function(e) { 22 let isTabPressed = e.key === 'Tab' || e.keyCode === 9; 23 if (!isTabPressed) { 24 return; 25 } 26 if (e.shiftKey) { // if shift key pressed for shift + tab combination 27 if (document.activeElement === firstFocusableElement) { 28 lastFocusableElement.focus();
28 // add focus for the last focusable element 29 e.preventDefault(); 30 } 31 } else { // if tab key is pressed 32 if (document.activeElement === lastFocusableElement) { // if focused has reached to last focusable element then focus first focusable element after pressing tab 33 modal_1.focus(); // add focus for the first focusable element 34 e.preventDefault(); 35 } 36 } 37 }); 38 firstFocusableElement.focus(); 39 } 40 } else { 41 jQuery("#site-navigation").hide(400); 42 } 43 },200); 44 }); 45});
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.