1(function( $ ) { 2 "use strict"; 3 4 function initMainNavigation( container ) { 5 6 // Add dropdown toggle that displays child menu items. 7 var dropdownToggle = $( '<button />', { 'class': 'dropdown-toggle', 'aria-expanded': false }) 8 .append( $( '<span />', { 'class': 'screen-reader-text', text: businesspressScreenReaderText.expand }) ); 9 10 container.find( '.menu-item-has-children > a, .page_item_has_children > a' ).after( dropdownToggle ); 11 12 // Set the active submenu dropdown toggle button initial state. 13 container.find( '.current-menu-ancestor > button' ) 14 .addClass( 'toggled-on' ) 15 .attr( 'aria-expanded', 'true' ) 16 .find( '.screen-reader-text' ) 17 .text( businesspressScreenReaderText.collapse ); 18 // Set the active submenu initial state. 19 container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' ); 20 21 container.find( '.dropdown-toggle' ).click( function( e ) { 22 var _this = $( this ), 23 screenReaderSpan = _this.find( '.screen-reader-text' ); 24 25 e.preventDefault(); 26 _this.toggleClass( 'toggled-on' ); 27 _this.next( '.children, .sub-menu' ).toggleClass( 'toggled-on' ); 28 29 _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); 30 31 screenReaderSpan.text( screenReaderSpan.text() === businesspressScreenReaderText.expand ? businesspressScreenReaderText.collapse : businesspressScreenReaderText.expand ); 32 }); 33 } 34 35 initMainNavigation( $( '.drawer-navigation .main-navigation' ) ); 36})( jQuery );
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.