1/** 2 * navigation.js 3 * 4 * Handles toggling the navigation menu for small screens. 5 */ 6( function() { 7 var nav = document.getElementById( 'menu-header_main_menu' ), button, menu; 8 if ( ! nav ) 9 return; 10 button = nav.getElementsByTagName( 'h3' )[0]; 11 menu = nav.getElementsByTagName( 'ul' )[0]; 12 if ( ! button ) 13 return; 14 // Hide button if menu is missing or empty. 15 if ( ! menu || ! menu.childNodes.length ) { 16 button.style.display = 'none'; 17 return; 18 } 19 button.onclick = function() { 20 if ( -1 == menu.className.indexOf( 'nav-menu' ) ) 21 menu.className = 'nav-menu'; 22 if ( -1 != button.className.indexOf( 'toggled-on' ) ) { 23 button.className = button.className.replace( ' toggled-on', '' ); 24 menu.className = menu.className.replace( ' toggled-on', '' ); 25 } else { 26 button.className += ' toggled-on'; 27 menu.className += ' toggled-on'; 28 } 29 }; 30} )();
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.