1(function($) 2{ 3 "use strict"; 4 $.avia_utilities = $.avia_utilities || {}; 5 6 $(document).ready(function() 7 { 8 //activates the sticky submenu 9 $.avia_utilities = $.avia_utilities || {}; 10 if($.avia_utilities.avia_sticky_submenu) 11 $.avia_utilities.avia_sticky_submenu(); 12 }); 13 14 15 $.avia_utilities.avia_sticky_submenu = function() 16 { 17 var win = $(window), 18 html = $('html:first'), 19 header = $('.html_header_top.html_header_sticky #header'), 20 html_margin = parseInt( $('html:first').css('margin-top'), 10), 21 setWitdth = $('.html_header_sidebar #main, .boxed #main'), 22 menus = $('.av-submenu-container'), 23 bordermod = html.is('.html_minimal_header') ? 0 : 1, 24 fixed_frame = $('.av-frame-top').height(), 25 calc_margin = function() 26 { 27 html_margin = parseInt( html.css('margin-top'), 10); 28 if(!$('.mobile_menu_toggle:visible').length) 29 { 30 $('.av-open-submenu').removeClass('av-open-submenu'); 31 } 32 33 menus.filter('.av-sticky-submenu').each(function() 34 { 35 $(this).next('.sticky_placeholder').height($(this).height()); 36 }); 37 38 }, 39 calc_values = function() 40 { 41 var content_width = setWitdth.width(); 42 html_margin = parseInt( html.css('margin-top'), 10); 43 menus.width(content_width); 44 }, 45 check = function(placeholder, no_timeout) 46 { 47 var menu_pos = this.offset().top, 48 top_pos = placeholder.offset().top, 49 scrolled = win.scrollTop(), 50 modifier = html_margin, fixed = false; 51 52 if(header.length) 53 { 54 modifier += header.outerHeight() + parseInt( header.css('margin-top'), 10); 55 } 56 57 if(fixed_frame) 58 { 59 modifier += fixed_frame; 60 } 61 62 if(scrolled + modifier > top_pos) 63 { 64 if(!fixed) 65 { 66 this.css({top: modifier - bordermod, position: 'fixed'}); fixed = true 67 } 68 } 69 else 70 { 71 this.css({top: 'auto', position: 'absolute'}); fixed = false 72 } 73 74 }, 75 toggle = function(e) 76 { 77 e.preventDefault(); 78 79 var clicked = $(this), 80 menu = clicked.siblings('.av-subnav-menu'); 81 82 if(menu.hasClass('av-open-submenu')) 83 { 84 menu.removeClass('av-open-submenu'); 85 } 86 else 87 { 88 menu.addClass('av-open-submenu'); 89 } 90 }; 91 92 win.on("debouncedresize av-height-change", calc_margin ); calc_margin(); 93 94 if(setWitdth.length) 95 { 96 win.on("debouncedresize av-height-change", calc_values ); 97 calc_values(); 98 } 99 100 101 menus.each(function() 102 { 103 var menu = $(this), sticky = menu.filter('.av-sticky-submenu'), placeholder = menu.next('.sticky_placeholder'), mobile_button = menu.find('.mobile_menu_toggle'); 104 105 106 if(sticky.length) win.on( 'scroll', function(){ window.requestAnimationFrame( $.proxy( check, sticky, placeholder) )} ); 107 108 if(mobile_button.length) 109 { 110 mobile_button.on( 'click', toggle ); 111 } 112 }); 113 114 115 html.on('click', '.av-submenu-hidden .av-open-submenu li a', function() 116 { 117 var current = $(this); 118 119 var list_item = current.siblings('ul, .avia_mega_div'); 120 if(list_item.length) 121 { 122 if(list_item.hasClass('av-visible-sublist')) 123 { 124 list_item.removeClass('av-visible-sublist'); 125 } 126 else 127 { 128 list_item.addClass('av-visible-sublist'); 129 } 130 return false; 131 } 132 }); 133 134 $('.avia_mobile').on('click', '.av-menu-mobile-disabled li a', function() 135 { 136 var current = $(this); 137 var list_item = current.siblings('ul'); 138 if(list_item.length) 139 { 140 if(list_item.hasClass('av-visible-mobile-sublist')) 141 { 142 143 } 144 else 145 { 146 $('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist'); 147 list_item.addClass('av-visible-mobile-sublist'); 148 return false; 149 } 150 151 } 152 }); 153 154 155 156 } 157 158 159}(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.