/** * File navigation.js. * * Handles toggling the navigation menu for small screens and enables TAB key * navigation support for dropdown menus. */ /* global altoFocusScreenReaderText */ ( function( $ ) { var body, masthead = $( '#masthead' ), menuToggle = masthead.find( '.menu-toggle' ), siteMenu = masthead.find( '.top-navigation' ), siteNavigation = masthead.find( '.top-navigation > div' ), siteBrandingHeight = masthead.find( '.site-branding-wrap' ).outerHeight(), topNavigation = $( '.top-navigation' ); /** * Initialize the main navigation */ function initMainNavigation( container ) { // Add parent class to sub-menu parent items container.find( '.sub-menu, .children' ).parents( 'li' ).addClass( 'menu-item-has-children' ); // Add dropdown toggle button var dropdownToggle = $( '