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