1$(document).ready(function () { 2 var $header = $('header'); 3 var $body = $('body'); 4 var $mobileToggle = $('.mobile-toggle'); 5 var $mobileMenu = $('.mobile-nav'); 6 var $scrollLogo = $('.scrolling-logo'); 7 var $logo = $('.main-logo'); 8 var $navToggle = $('.nav-toggle-color') 9 10 $(window).scroll(function () { 11 if ($(document).scrollTop() > 1) { 12 $body.addClass("scroll"); 13 $header.find('.header-font-color').addClass('scroll-header-font-color'); 14 $navToggle.addClass('nav-toggle-scrolling-color'); 15 16 if ($scrollLogo.length > 0) { 17 $logo.hide(); 18 $scrollLogo.show(); 19 } 20 } else { 21 // Show the scroll styling at all times on the /items/item/{item-name} page as the banner is hidden. 22 if (!$body.hasClass('item-view')) { 23 $body.removeClass("scroll"); 24 $header.find('.header-font-color').removeClass('scroll-header-font-color'); 25 $navToggle.removeClass('nav-toggle-scrolling-color'); 26 27 if ($scrollLogo.length > 0) { 28 $logo.show(); 29 $scrollLogo.hide(); 30 } 31 } 32 } 33 }); 34 35 $('.menu-search').on( 'click', function(e) { 36 e.stopPropagation(); 37 38 $('.menu-search-box').addClass('open'); 39 $('.menu-search-box input').focus(); 40 }); 41 42 $('#isPickUp, #isDelivery').on("change", function () { 43 if ($('#isDelivery').is(":checked")) { 44 $('.site-label').text("Your Closest Store"); 45 $('.site-address').hide(); 46 } else if ($('#isPickUp').is(":checked")) { 47 $('.site-label').text("Your Pickup Store"); 48 $('.site-address').show(); 49 } 50 }); 51 52 $('#isPickUp, #isDelivery').trigger("change"); 53 54 $('body').on('click', '.search-action', function () { 55 $(this).toggleAriaExpanded(true); 56 $('.search-container').css('display', 'flex'); 57 $('.search-container').height($header.height() + 20); 58 $header.toggleClass('search-open'); 59 $('.search-container input').attr("tabindex", 0).focus(); 60 $('.search-liner button').attr("tabindex", 0); 61 }); 62 63 $('body').on('click', '.search-close', function () { 64 $header.toggleClass('search-open'); 65 $('.search-container input').attr("tabindex", -1); 66 $('.search-liner button').attr("tabindex", -1); 67 $('.search-container').css('display', 'none'); 68 $('.search-action').toggleAriaExpanded(false).focus(); 69 }); 70 71 $mobileToggle.on('click', function () { 72 $(this).find(".toggle-icon").toggleClass('open'); 73 $(this).toggleAriaExpanded(); 74 75 $mobileMenu.slideToggle('fast', function () { 76 77 if ($mobileMenu.height() + $header.height() + 50 > $(window).height()) { 78 $mobileMenu.height($(window).height() - $header.height()); 79 $mobileMenu.css('overflow-y', 'scroll'); 80 81 if ($('body').hasClass('mega-open')) { 82 $('body').addClass('menu-open--overflow'); 83 } 84 } 85 }); 86 }); 87 88 function setMobileSubmenuExpanded($toggle, expanded) { 89 var submenuId = $toggle.attr('aria-controls'); 90 var submenu = submenuId ? document.getElementById(submenuId) : null; 91 92 if (!submenu) { 93 return; 94 } 95 96 $toggle.attr('aria-expanded', expanded ? 'true' : 'false'); 97 submenu.hidden = !expanded; 98 } 99 100 $mobileMenu.on('click', '.mobile-menu-toggle', function () { 101 var $toggle = $(this); 102 var willExpand = $toggle.attr('aria-expanded') !== 'true'; 103 104 if (willExpand) { 105 $toggle.closest('li').siblings('li').find('.mobile-menu-toggle[aria-expanded="true"]').each(function () { 106 setMobileSubmenuExpanded($(this), false); 107 }); 108 } 109 110 setMobileSubmenuExpanded($toggle, willExpand); 111 }); 112 113 if (isIE()) { 114 // Dropdown list fix for IE. Wrapped as breaks accessibility in other browsers 115 $(".parent-item").on("mouseover", function () { 116 117 $(this).find(".menu-list-dropdown").css("display", "block"); //display on enter 118 119 }) 120 121 $(".parent-item .menu-list-dropdown").on("mouseleave", function () { 122 123 $(this).css("display", "none"); // remove on leave 124 }) 125 } 126 127}); 128 129$.fn.toggleAriaExpanded = function (expandedOverride) { 130 // Toggle between on and off or allow manual selection through parameter 131 var ariaExpanded = $(this).prop("ariaExpanded") === "true"; 132 $(this).prop("ariaExpanded", expandedOverride != undefined ? expandedOverride : !ariaExpanded); 133 return $(this); 134} 135 136function isIE() { 137 // updated check for IE 11 138 if (window.navigator.userAgent) { 139 return (window.navigator.userAgent.indexOf("MSIE") > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)); 140 } 141 142 return false; 143}
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.