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 // Sticky nav bar 24 var h = $('.navbarprimary').offset().top; 25 $(window).scroll(function () { 26 if( $(this).scrollTop() > h ) { 27 $('.navbarprimary').addClass('sticky_menu_top'); 28 } else { 29 $('.navbarprimary').removeClass('sticky_menu_top'); 30 } 31 32 }); 33 34 // Make accessible menu 35 var links = $( '.navbarprimary .navbar-collapse a' ); 36 37 // Each time a menu link is focused or blurred, toggle focus. 38 for ( i = 0, len = links.length; i < len; i++ ) { 39 links[i].addEventListener( 'focus', toggleFocus, true ); 40 links[i].addEventListener( 'blur', toggleFocus, true ); 41 } 42 43 /** 44 * Sets or removes .focus class on an element. 45 */ 46 function toggleFocus() { 47 var self = this; 48 49 // Move up through the ancestors of the current link until we hit .nav-menu. 50 while ( -1 === self.className.indexOf( 'navbar-nav' ) ) { 51 52 // On li elements toggle the class .focus. 53 if ( 'li' === self.tagName.toLowerCase() ) { 54 55 if ( -1 !== self.className.indexOf( 'focus' ) ) { 56 self.className = self.className.replace( ' focus', '' ); 57 } else { 58 self.className += ' focus'; 59 } 60 } 61 self = self.parentElement; 62 } 63 } 64 65 }); 66} )( 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.