1(function($) 2{ 3 "use strict"; 4 5 $(document).ready(function() 6 { 7 // decreases header size when user scrolls down 8 avia_header_size(); 9 }); 10 11 12 function av_change_class($element, change_method, class_name) 13 { 14 if($element[0].classList) 15 { 16 if(change_method == "add") 17 { 18 $element[0].classList.add(class_name); 19 } 20 else 21 { 22 $element[0].classList.remove(class_name); 23 } 24 } 25 else 26 { 27 if(change_method == "add") 28 { 29 $element.addClass(class_name); 30 } 31 else 32 { 33 $element.removeClass(class_name); 34 } 35 } 36 } 37 38 39 function avia_header_size() 40 { 41 var win = $(window), 42 header = $('.html_header_top.html_header_sticky #header'), 43 unsticktop = $('.av_header_unstick_top'); 44 45 if( ! header.length && ! unsticktop.length ) 46 { 47 return; 48 } 49 50 var logo = $('#header_main .container .logo img, #header_main .container .logo a'), 51 elements = $('#header_main .container:not(#header_main_alternate>.container), #header_main .main_menu ul:first-child > li > a:not(.avia_mega_div a, #header_main_alternate a), #header_main #menu-item-shop .cart_dropdown_link'), 52 el_height = $(elements).first().height(), 53 isMobile = $.avia_utilities.isMobile, 54 scroll_top = $('#scroll-top-link'), 55 transparent = header.is('.av_header_transparency'), 56 shrinking = header.is('.av_header_shrinking'), 57 header_meta = header.find('#header_meta'), 58 topbar_height = header_meta.length ? header_meta.outerHeight() : 0, 59 set_height = function() 60 { 61 var st = win.scrollTop(), 62 newH = 0, 63 st_real = st; 64 65 if( unsticktop ) 66 { 67 st -= topbar_height; 68 } 69 70 if( st < 0 ) 71 { 72 st = 0; 73 } 74 75 if( shrinking && ! isMobile ) 76 { 77 if( st < el_height/2 ) 78 { 79 newH = el_height - st; 80 if( st <= 0 ) 81 { 82 newH = el_height; 83 } 84 85 av_change_class( header, 'remove', 'header-scrolled' ); 86 //header.removeClass('header-scrolled'); 87 } 88 else 89 { 90 newH = el_height/2; 91 //header.addClass('header-scrolled'); 92 av_change_class( header, 'add', 'header-scrolled' ); 93 } 94 95 if( st - 30 < el_height ) 96 { 97 av_change_class( header, 'remove', 'header-scrolled-full' ); 98 } 99 else 100 { 101 av_change_class( header, 'add', 'header-scrolled-full' ); 102 } 103 104 105 elements.css({'height': newH + 'px', 'lineHeight': newH + 'px'}); 106 logo.css({'maxHeight': newH + 'px'}); 107 } 108 109 if( unsticktop.length ) 110 { 111 if( st <= 0 ) 112 { 113 if( st_real <= 0 ) 114 { 115 st_real = 0; 116 } 117 118 unsticktop.css({"margin-top":"-"+st_real+"px"}); 119 } 120 else 121 { 122 unsticktop.css({"margin-top":"-"+topbar_height+"px"}); 123 } 124 } 125 126 if( transparent ) 127 { 128 if( st > 50 ) 129 { 130 //header.removeClass('av_header_transparency'); 131 av_change_class( header, 'remove', 'av_header_transparency' ); 132 } 133 else 134 { 135 //header.addClass('av_header_transparency'); 136 av_change_class( header, 'add', 'av_header_transparency' ); 137 } 138 } 139 140 141 }; 142 143 if( $('body').is( '.avia_deactivate_menu_resize' ) ) 144 { 145 shrinking = false; 146 } 147 148 if( ! transparent && ! shrinking && ! unsticktop.length ) 149 { 150 return; 151 } 152 153 win.on( 'debouncedresize', function(){ 154 el_height = $( elements ).attr( 'style',"" ).first().height(); 155 set_height(); 156 }); 157 158 win.on( 'scroll', function(){ 159 window.requestAnimationFrame( set_height ); 160 }); 161 162 set_height(); 163 } 164 165 166})(jQuery); 167
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.