1/** 2 * navigation.js 3 * 4 * Handles toggling the navigation menu for small screens. 5 */ 6( function() { 7 8 var containers = document.getElementsByClassName( 'button-menu' ); 9 var i; 10 for (i = 0; i < containers.length; i++) { 11 set_button_style( containers[i].id ); 12 } 13} )(); 14 15function set_button_style(id) { 16 17 var container = document.getElementById( id ); 18 19 if ( undefined == container ) 20 return; 21 22 var button = container.getElementsByTagName( 'h1' )[0], 23 menu = container.getElementsByTagName( 'ul' )[0]; 24 25 if ( undefined == button ) 26 return; 27 28 if( undefined == menu ) { 29 button.style.display = 'none'; 30 } else { 31 button.onclick = function() { 32 if ( -1 != button.className.indexOf( 'toggled-on' ) ) { 33 button.className = button.className.replace( ' toggled-on', '' ); 34 menu.className = menu.className.replace( ' toggled-on', '' ); 35 } else { 36 button.className += ' toggled-on'; 37 menu.className += ' toggled-on'; 38 } 39 }; 40 41 // Hide menu toggle button if menu is empty. 42 if ( ! menu.childNodes.length ) 43 button.style.display = 'none'; 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.