1$(document).ready(function() { 2 3 var carlsbergGroupHeader = (function() { 4 5 // 'Private' 6 function init(){ 7 menuButton(); // Handles appearance of 'Menu' text in mobile nav 8 contentFix(); // Switches to mobile nav if desktop menu contains too many items 9 } 10 11 function menuButton(){ 12 var _body = $('body'); 13 $(window).scroll(function() { 14 var scroll = $(window).scrollTop(); 15 if (scroll >= 5) { 16 _body.addClass('scrolled'); 17 }else{ 18 _body.removeClass('scrolled'); 19 } 20 }); 21 } 22 23 function contentFix(){ 24 var resized; 25 $(window).on('resize orientationChanged load', function(){ 26 clearTimeout(resized); 27 resized = setTimeout(resizeCallback, 100); 28 }); 29 resizeCallback(); 30 } 31 32 function resizeCallback(){ 33 var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 34 if(windowWidth > 992){ 35 var navContainer = $('.header__section--nav-container'); 36 var headerWidth = $('.header__inner .col-md-12').width(); 37 var navWidth = navContainer.outerWidth(); 38 var logoWidth = $('.header__section--logo-container').outerWidth(); 39 40 navContainer.show(); 41 42 if(headerWidth < navWidth + logoWidth){ 43 $('body').addClass('force-mobile-nav'); 44 navContainer.hide(); 45 }else{ 46 $('body').removeClass('force-mobile-nav'); 47 } 48 } 49 } 50 51 // 'Public' 52 return { 53 init: init 54 }; 55 56 })(); 57 58 carlsbergGroupHeader.init(); 59}); 60 61 62
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.