1( function( $ ) { 2 $(document).ready(function() { 3 4 // Nav Main DD Toggle 5 $( ".navbarprimary .dropdowntoggle" ).click( function() { 6 if( $(this).parent('li').hasClass('navbarprimary-open') ) { 7 $(this).parent('li').removeClass('navbarprimary-open'); 8 } else { 9 $(this).parent('li').addClass('navbarprimary-open'); 10 } 11 12 if( $(this).children('a').children('span').hasClass('fa-chevron-circle-down') ) { 13 $(this).children('a').children('span').removeClass('fa-chevron-circle-down'); 14 $(this).children('a').children('span').addClass('fa-chevron-circle-right'); 15 } else { 16 $(this).children('a').children('span').removeClass('fa-chevron-circle-right'); 17 $(this).children('a').children('span').addClass('fa-chevron-circle-down'); 18 } 19 20 return false; 21 }); 22 23 // Make accessible menu 24 var links = $( '.navbarprimary .navbar-collapse a' ); 25 26 // Each time a menu link is focused or blurred, toggle focus. 27 for ( i = 0, len = links.length; i < len; i++ ) { 28 links[i].addEventListener( 'focus', toggleFocus, true ); 29 links[i].addEventListener( 'blur', toggleFocus, true ); 30 } 31 32 /** 33 * Sets or removes .focus class on an element. 34 */ 35 function toggleFocus() { 36 var self = this; 37 38 // Move up through the ancestors of the current link until we hit .nav-menu. 39 while ( -1 === self.className.indexOf( 'navbar-nav' ) ) { 40 41 // On li elements toggle the class .focus. 42 if ( 'li' === self.tagName.toLowerCase() ) { 43 44 if ( -1 !== self.className.indexOf( 'focus' ) ) { 45 self.className = self.className.replace( ' focus', '' ); 46 } else { 47 self.className += ' focus'; 48 } 49 } 50 self = self.parentElement; 51 } 52 } 53 54 }); 55} )( 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.