1( function( window, document ) { 2 function elearning_education_keepFocusInMenu() { 3 document.addEventListener( 'keydown', function( e ) { 4 const elearning_education_nav = document.querySelector( '.sidenav' ); 5 if ( ! elearning_education_nav || ! elearning_education_nav.classList.contains( 'open' ) ) { 6 return; 7 } 8 const elements = [...elearning_education_nav.querySelectorAll( 'input, a, button' )], 9 elearning_education_lastEl = elements[ elements.length - 1 ], 10 elearning_education_firstEl = elements[0], 11 elearning_education_activeEl = document.activeElement, 12 tabKey = e.keyCode === 9, 13 shiftKey = e.shiftKey; 14 if ( ! shiftKey && tabKey && elearning_education_lastEl === elearning_education_activeEl ) { 15 e.preventDefault(); 16 elearning_education_firstEl.focus(); 17 } 18 if ( shiftKey && tabKey && elearning_education_firstEl === elearning_education_activeEl ) { 19 e.preventDefault(); 20 elearning_education_lastEl.focus(); 21 } 22 } ); 23 } 24 elearning_education_keepFocusInMenu(); 25} )( window, document );
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.