1(function ($) { 2 'use strict'; 3 4 5 function handleWindow() { 6 var body = document.querySelector('body'); 7 8 if (window.innerWidth > body.clientWidth + 5) { 9 body.classList.add('has-scrollbar'); 10 body.setAttribute('style', '--scroll-bar: ' + (window.innerWidth - body.clientWidth) + 'px'); 11 } else { 12 body.classList.remove('has-scrollbar'); 13 } 14 } 15 16 function minHeight() { 17 var $body = $('body'), 18 bodyHeight = $(window).outerHeight(), 19 headerHeight = $('header.header-1').outerHeight(), 20 footerHeight = $('footer.site-footer').outerHeight(); 21 if($body.find('header.header-1').length){ 22 23 $('.site-content').css({ 24 'min-height': bodyHeight - headerHeight - footerHeight - 94 25 }); 26 } 27 } 28 29 function setPositionLvN($item) { 30 var sub = $item.children('.sub-menu'), 31 offset = $item.offset(), 32 width = $item.outerWidth(), 33 screen_width = $(window).width(), 34 sub_width = sub.outerWidth(); 35 var align_delta = offset.left + width + sub_width - screen_width; 36 if (align_delta > 0) { 37 if ($item.parents('.menu-item-has-children').length) { 38 sub.css({ left: 'auto', right: '100%' }); 39 }else { 40 sub.css({ left: 'auto', right: '0' }); 41 } 42 } else { 43 sub.css({ left: '', right: '' }); 44 } 45 } 46 47 function initSubmenuHover() { 48 $('.site-header .main-navigation .menu-item-has-children').hover(function (event) { 49 var $item = $(event.currentTarget); 50 setPositionLvN($item); 51 }); 52 } 53 54 function account_side() { 55 var $account_side = $('body .header-group-action .site-header-account a'); 56 var $account_active = $('body .header-group-action .site-header-account .account-dropdown'); 57 $(document).mouseup(function (e) { 58 if ($account_side.has(e.target).length == 0 && !$account_active.is(e.target) && $account_active.has(e.target).length == 0) { 59 $account_active.removeClass('active'); 60 } 61 }); 62 $account_side.on('click', function (e) { 63 e.preventDefault(); 64 e.stopPropagation(); 65 $account_active.toggleClass('active'); 66 }); 67 } 68 $(document).ready(function () { 69 account_side(); 70 }); 71 72 function backtotop() { 73 $(window).scroll(function(){ 74 if ($(this).scrollTop() > 50) { 75 $('.scrollup').addClass('activate'); 76 } else { 77 $('.scrollup').removeClass('activate'); 78 } 79 }); 80 $('.scrollup').on('click', function () { 81 $("html, body").animate({scrollTop: 0}, 600); 82 return false; 83 }); 84 } 85 86 initSubmenuHover(); 87 minHeight(); 88 handleWindow(); 89 backtotop(); 90 91})(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.