1;(function ($, lflegal, undefined) { 2 var mainMenu = $('#menu-primary'); 3 var toggle = $('#nav-toggle'); 4 var mobileMenu; 5 6 var menuInit = function() { 7 mobileMenu = mainMenu.clone(); 8 mobileMenu.attr('id', 'menu-primary-mobile'); 9 mobileMenu.attr('tabindex', '-1'); 10 mobileMenu.find('ul.menu-items').attr('id', 'menu-mobile-items'); 11 var menuItems = mobileMenu.find('li[id]'); 12 menuItems.each(function(){ 13 var item = $(this); 14 var id = item.attr('id'); 15 item.attr('id', 'mobile-' + id); 16 }); 17 mobileMenu.removeClass('main-navigation').addClass('main-navigation-mobile'); 18 mainMenu.after(mobileMenu); 19 20 a11yNav(); 21 mobileNav(); 22 skipToNav(); 23 } 24 25 var a11yNav = function() { 26 mainMenu.accessibleMegaMenu({ 27 uuidPrefix: "primary-menu", 28 }); 29 }; 30 31 var mobileNav = function() { 32 /* Open menu when toggle is clicked */ 33 toggle.on('click', function(e){ 34 $(this).toggleClass('active'); 35 mobileMenu.toggleClass('opened'); 36 }); 37 38 /* Add toggles to parent items */ 39 var parents = mobileMenu.find('li.menu-item-has-children'); 40 parents.each(function(){ 41 var subToggle = $('<button class="dropdown-toggle" aria-expanded="false"><span class="screen-reader-text">Expand child menu</span></button'); 42 var subMenu = $(this).find('.sub-menu'); 43 subMenu.before(subToggle); 44 subToggle.on('click', function(e){ 45 $(this).toggleClass('toggled'); 46 subMenu.toggleClass('opened'); 47 var expanded = subToggle.attr('aria-expanded') === 'true' ? true : false; 48 subToggle.attr('aria-expanded', !expanded); 49 }); 50 51 }); 52 }; 53 54 var skipToNav = function() { 55 var skipLink = $('a[href="#menu-primary"]'); 56 57 skipLink.on('click', function(e) { 58 if (!mainMenu.is(':visible')) { 59 e.preventDefault(); 60 toggle.trigger('click'); 61 mobileMenu.focus(); 62 } 63 }) 64 } 65 66 var balanceLines = function() { 67 $('.balance-lines').each(function(){ 68 $(this).width('100%'); 69 var currentHeight = $(this).height(); 70 var thisHeight = currentHeight; 71 var currentWidth = $(this).width(); 72 var newWidth = currentWidth; 73 // Try shrinking width until height changes 74 while (thisHeight == currentHeight) { 75 var testWidth = newWidth - 10; 76 $(this).width(testWidth); 77 thisHeight = $(this).height(); 78 if (thisHeight == currentHeight) { 79 newWidth = testWidth; 80 } else { 81 break; 82 } 83 } 84 $(this).width(newWidth); 85 }); 86 }; 87 88 lflegal.init = function() { 89 menuInit(); 90 balanceLines(); 91 }; 92 93}(jQuery, window.lflegal = window.lflegal || {})); 94 95 96jQuery(function(){ 97 lflegal.init(); 98});
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.