1$(document).ready(function(){ 2 // Write javascript on load here 3 // Your Screen Size 4 var myScreen = $('html').width(); 5 6 // Desktop Screen Sizes 7 var mdScreenHigh = '975'; 8 var mdScreenLow = '974'; 9 10 // Smaller Screen Sizes 11 var smScreenHigh = '751'; 12 var smScreenLow = '750'; 13}); 14 15// Nav menu toggle 16$('#menuToggle').click(function(e) { 17 $('.navigation .menu').toggleClass('active'); 18 $('.navigation #menuToggle').toggleClass('active'); 19 // $("body").toggleClass("overflow-hidden"); 20 $("body").toggleClass("menu-open"); 21 $(".body-bg").toggleClass("menu-open"); 22}); 23 24$('#closeToggle').click(function (e) { 25 $('.navigation .menu').removeClass('active'); 26 $('.navigation #menuToggle').removeClass('active'); 27 // $("body").removeClass("overflow-hidden"); 28 $("body").removeClass("menu-open"); 29 $(".body-bg").removeClass("menu-open"); 30}); 31 32$(window).on('resize load', function(){ 33 // If the hamburger icon is hidden then also hide the dropdown menus. 34 if (!$('#menuToggle').is(':visible')) { 35 $('.navigation .menu, .sub-menu').css('display', ''); 36 } 37}); 38 39$('#menuToggle, .navigation .menu').click(function(e) { 40 // This prevents the click event from hitting the body which also has an event to close the nav. 41 e.stopPropagation(); 42}); 43 44// If the user clicks anywhere on the page and it's not a nav item, close the menu. 45$('body').click(function(e) { 46 if ($('#menuToggle').is(':visible')) { 47 $('.navigation .menu').removeClass('active'); 48 $('.navigation #menuToggle').removeClass('active'); 49 $("body").removeClass("overflow-hidden"); 50 $("body").removeClass("menu-open"); 51 $(".body-bg").removeClass("menu-open"); 52 } 53}); 54 55$('.sub-menu-toggle').click(function(e) { 56 e.preventDefault(); 57 $(this).parent().siblings('.sub-menu').toggle(); 58 $(this).toggleClass('open'); 59 60 // select toggle for parent list item 61 if ($(this).parent().parent().siblings('li').children('a').hasClass('open')) { 62 $(this).parent().parent().siblings('li').children('a').removeClass('open'); 63 } 64 $(this).parent().toggleClass('open'); 65 66 $(this).parents('li').eq(0).siblings().each(function(){ 67 var toggle = $(this).find('.sub-menu-toggle').eq(0); 68 69 if ( toggle.hasClass('open') ){ 70 toggle.removeClass('open'); 71 $(this).find('ul').eq(0).toggle(); 72 } 73 }); 74}); 75 76$('.third-level-toggle').click(function (e) { 77 e.preventDefault(); 78 $(this).parent().siblings('.third-level-menu').toggle(); 79 $(this).toggleClass('open'); 80 81 // select toggle for parent list item 82 if ($(this).parent().parent().siblings('li').children('a').hasClass('open')) { 83 $(this).parent().parent().siblings('li').children('a').removeClass('open'); 84 } 85 $(this).parent().toggleClass('open'); 86 87 $(this).parents('li').eq(0).siblings().each(function () { 88 var toggle = $(this).find('.third-level-toggle').eq(0); 89 90 if (toggle.hasClass('open')) { 91 toggle.removeClass('open'); 92 $(this).find('ul').eq(0).toggle(); 93 } 94 }); 95}); 96 97// Nav menu scrolling 98var navBarHeight = $('header.header').outerHeight(); 99var topBarHeight = $('#topBar').outerHeight(); 100var scroll = $(window).scrollTop(); 101 102// if (scroll >= navBarHeight + topBarHeight) { 103if (scroll >= topBarHeight) { 104 $('header.header').addClass('scrolled'); 105 $('#alertBanner').addClass('scrolled'); 106} else { 107 $('header.header').removeClass('scrolled'); 108 $('#alertBanner').removeClass('scrolled'); 109 110 // The height of the navigation bar = the padding of the body. This prevents the nav from overlapping the content. 111// Without topBar showing 112// document.querySelector('.body-bg').style.paddingTop = document.querySelector('header.header').offsetHeight + 'px'; 113// With topBar showing 114let topbarOffsetHeight = (!!document.querySelector('#topBar'))? document.querySelector('#topBar').offsetHeight : 0; // if topbar doesn't exist, use 0px 115// document.querySelector('.body-bg').style.paddingTop = document.querySelector('header.header').offsetHeight + topbarOffsetHeight + 'px'; 116// document.querySelector('.body-bg').style.paddingTop = topbarOffsetHeight + 'px'; 117document.querySelector('.body-bg').style.paddingTop =(!!document.querySelector('.backendlayout-homepage'))? topbarOffsetHeight + 'px' : document.querySelector('header.header').offsetHeight + topbarOffsetHeight + 'px'; 118} 119 120$(window).scroll(function () { 121 var navBarHeight = $('header.header').outerHeight();
122 var topBarHeight = $('#topBar').outerHeight(); 123 var scroll = $(window).scrollTop(); 124 125 if (scroll >= navBarHeight + topBarHeight) { 126 $('header.header').addClass('scrolled'); 127 $('#alertBanner').addClass('scrolled'); 128 } else { 129 $('header.header').removeClass('scrolled'); 130 $('#alertBanner').removeClass('scrolled'); 131 } 132}); 133 134// TopBar Hiding 135$('#alertBanner #alertBannerToggle').click(function () { 136 $('#alertBanner').addClass('d-none'); 137}); 138 139// Nav Search Toggle 140$('.navigation .search-container .search-toggle').click(function (e) { 141 $('.navigation .search-container #form_kesearch_nav .kesearch_searchbox').toggleClass('open'); 142}); 143 144$('.navigation .search-container .search-toggle, .navigation .search-container #form_kesearch_nav .kesearch_searchbox').click(function (e) { 145 e.stopPropagation(); 146}); 147 148$('body').click(function (e) { 149 if ($('.navigation .search-container #form_kesearch_nav .kesearch_searchbox').hasClass('open')) { 150 $('.navigation .search-container #form_kesearch_nav .kesearch_searchbox').removeClass('open'); 151 } 152}); 153 154function isIE() { 155 if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1)) { 156 return true; 157 } else { 158 return false; 159 } 160} 161 162function isEdge() { 163 if (navigator.userAgent.match(/Edge/)) { 164 return true; 165 } else { 166 return false; 167 } 168} 169 170if (isIE()) { 171 $('html').addClass('ie'); 172 $('body').prepend('<span id="non-ie-required-message">Internet Explorer is not supported. Please use another browser.</span>'); // let people know IE sucks 173} 174 175if (isEdge()) { 176 $('html').addClass('edge'); 177} 178 179// DCE Image Slider 180$(document).ready(function(){ 181 var swiper = new Swiper('.news-list-view.swiper', { 182 slidesPerView: 1, 183 spaceBetween: 16, 184 navigation: { 185 nextEl: '.swiper-button-next', 186 prevEl: '.swiper-button-prev', 187 }, 188 breakpoints: { 189 576: { 190 slidesPerView: 2, 191 }, 192 768: { 193 slidesPerView: 3, 194 }, 195 } 196 }); 197});
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.