1"use strict"; 2 3(function ($) { 4 // Mobile nav breakpoint. Must match $nav-bp-down in 5 // source/css/custom/_variables.scss (Bootstrap "xl" = 1200px). 6 const MOBILE_NAV_BREAKPOINT = 1199; 7 function isMobile() { 8 return $(window).width() <= MOBILE_NAV_BREAKPOINT; 9 } 10 $(() => { 11 $(".nav-toggle-btn").click(e => { 12 e.preventDefault(); 13 const nav = $("#nav"); 14 const navOverlay = $(".nav-overlay"); 15 nav.toggleClass("nav-active"); 16 if (nav.hasClass("nav-active")) { 17 nav.css("display", "flex").hide().fadeIn(300); 18 navOverlay.fadeIn(300); 19 } else { 20 nav.fadeOut(300); 21 navOverlay.fadeOut(300); 22 } 23 $("body").toggleClass("mobile-no-scroll"); 24 $("body").toggleClass("mobile-nav-open"); 25 $(".nav-toggle-btn").toggleClass("nav-active"); 26 return false; 27 }); 28 $("#nav > .menu-item.menu-item-has-children").click(function (e) { 29 if (isMobile()) { 30 if ($(this).hasClass("nav-item--extended")) { 31 $("ul", this).stop().slideUp(150, "linear"); 32 } else { 33 $("ul", this).stop().slideDown(150, "linear"); 34 } 35 $(this).toggleClass("nav-item--extended"); 36 e.preventDefault(); 37 e.stopPropagation(); 38 } 39 }); 40 $("#nav .menu-item.menu-item-has-children .menu-item").click(function (e) { 41 if (isMobile()) { 42 e.stopPropagation(); 43 } 44 }); 45 $(window).on("resize", () => onResize()); 46 let prevMode = "mobile"; 47 function onResize() { 48 if (prevMode == "mobile" && !isMobile()) { 49 $(".menu-item").removeClass("nav-item--extended"); 50 $("body").removeClass("mobile-no-scroll"); 51 $("body").removeClass("mobile-nav-open"); 52 $("body").removeClass("nav-open"); 53 } 54 } 55 }); 56})(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.