/** * navigation.js * * Handles toggling the navigation menu for small screens. */ ( function() { var container, button, menu; container = document.getElementById( 'site-navigation' ); if ( ! container ) return; button = container.getElementsByTagName( 'label' )[0]; if ( 'undefined' === typeof button ) return; menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } if ( -1 === menu.className.indexOf( 'nav-menu' ) ) menu.className += ' nav-menu'; button.onclick = function() { if ( -1 !== container.className.indexOf( 'toggled' ) ) container.className = container.className.replace( ' toggled', '' ); else container.className += ' toggled'; }; } )(); /* playback timings (ms): LoadShardBlock: 108.202 (3) esindex: 0.008 captures_list: 122.746 CDXLines.iter: 10.94 (3) PetaboxLoader3.datanode: 739.416 (4) exclusion.robots.fetch: 0.194 (4) exclusion.robots: 0.658 exclusion.robots.policy: 0.301 RedisCDXSource: 0.632 PetaboxLoader3.resolve: 97.402 load_resource: 748.697 */