1(function($) { 2 "use strict"; 3 4 UNCODE.stickyElements = function() { 5 var isMobile_wide = UNCODE.isMobile && UNCODE.wwidth < 1024; 6 if (!isMobile_wide) { 7 8 var $pageHeader = $('#page-header'), 9 $headerRow = $('.vc_row', $pageHeader), 10 startSticky = false; 11 12 if ( $headerRow.hasClass('sticky-element') ) { 13 $headerRow.removeClass('sticky-element'); 14 $pageHeader.addClass('sticky-element'); 15 startSticky = true; 16 } 17 18 var calculateOffset = function(el) { 19 var getRowPadding = (!$(el).hasClass('with-bg')) ? $(el).closest('.row-parent').css("padding-top") : 0, 20 sideOffset = (getRowPadding != undefined && getRowPadding != 0) ? parseInt(getRowPadding.replace("px", "")) : 0, 21 shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ? $('.navbar-brand').data('padding-shrink')*2 : 0; 22 23 sideOffset += UNCODE.bodyBorder; 24 25 if (UNCODE.adminBarHeight > 0) sideOffset += UNCODE.adminBarHeight; 26 if ($('.menu-sticky .menu-container:not(.menu-hide)').length && !$('.menu-wrapper .menu-desktop-transparent').length) { 27 if ($('.menu-shrink').length) { 28 sideOffset += parseFloat( $('.navbar-brand').data('minheight') ) + shrink; 29 } else { 30 sideOffset += ($('body.hmenu-center').length ? $('#masthead .menu-container').outerHeight() : parseInt(UNCODE.menuMobileHeight)); 31 } 32 } 33 34 return sideOffset; 35 36 }, 37 38 initStickyElement = function() { 39 $.each($('.sticky-element'), function(index, element) { 40 $(element).stick_in_parent({ 41 sticky_class: 'is_stucked', 42 offset_top: calculateOffset(element), 43 bottoming: true, 44 inner_scrolling: SiteParameters.sticky_elements === 'on' 45 }); 46 }); 47 }; 48 49 requestTimeout(function() { 50 if ($('.sticky-element').length) { 51 52 if ($(window).width() > UNCODE.mediaQuery) { 53 initStickyElement(); 54 55 if ( startSticky === true ) { 56 $('#page-header').trigger('sticky_kit:recalc'); 57 } 58 } 59 60 $(window).on('resize', function(event) { 61 if ($(window).width() > UNCODE.mediaQuery) { 62 initStickyElement(); 63 } else { 64 $(".sticky-element").trigger("sticky_kit:detach"); 65 } 66 }); 67 } 68 }, 1000); 69 70 var $panels = $('.panel-collapse'); 71 if ( $panels.length ) { 72 $panels.each(function(){ 73 var $panel = $(this); 74 $panel.on('shown.bs.collapse hidden.bs.collapse', function(){ 75 $(document.body).trigger("sticky_kit:recalc"); 76 }); 77 }); 78 } 79 } 80}; 81 82 83})(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.