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