1jQuery(document).ready(function ($) { 2 // lazy load 3 if (fifuImageVars.fifu_lazy) 4 fifu_lazy(); 5 else { 6 // no WordPress lazy load for the top images 7 jQuery('img').each(function (index) { 8 if (jQuery(this).offset().top < jQuery(window).height()) { 9 jQuery(this).removeAttr('loading'); 10 } 11 }); 12 } 13 14 // woocommerce lightbox/zoom 15 disableClick($); 16 disableLink($); 17 18 // zoomImg 19 setTimeout(function () { 20 jQuery('img.zoomImg').css('z-index', ''); 21 }, 1000); 22 23 jQuery('img[height=1]').each(function (index) { 24 if (jQuery(this).attr('width') != 1) 25 jQuery(this).css('position', 'relative'); 26 }); 27}); 28 29jQuery(window).on('ajaxComplete', function () { 30 if (fifuImageVars.fifu_lazy) 31 fifu_lazy(); 32}); 33 34jQuery(document).ajaxSuccess(function ($) { 35 if (fifuImageVars.fifu_lazy) 36 fifu_lazy_ajax(); 37}); 38 39var observer = new MutationObserver(function (mutations) { 40 if (fifuImageVars.fifu_lazy) { 41 mutations.forEach(function (mutation) { 42 mutation.addedNodes.forEach(function (node) { 43 if (jQuery(node).find('img').length > 0) { 44 // ignore WooCommerce zoom 45 if (!jQuery(node).hasClass('pswp__zoom-wrap')) { 46 jQuery(node).find('img').each(function (index) { 47 fifu_lazy_ajax(this); 48 }); 49 } 50 return; 51 } else if (jQuery(node).prop('tagName') == 'IMG') { 52 // ignore WooCommerce zoom 53 if (!jQuery(node).hasClass('zoomImg')) 54 fifu_lazy_ajax(node); 55 return; 56 } 57 }); 58 }); 59 } 60}); 61observer.observe(document, {attributes: false, childList: true, characterData: false, subtree: true}); 62 63function disableClick($) { 64 if (!fifuImageVars.fifu_woo_lbox_enabled) { 65 firstParentClass = ''; 66 parentClass = ''; 67 jQuery('figure.woocommerce-product-gallery__wrapper').find('div.woocommerce-product-gallery__image').each(function (index) { 68 parentClass = jQuery(this).parent().attr('class').split(' ')[0]; 69 if (!firstParentClass) 70 firstParentClass = parentClass; 71 72 if (parentClass != firstParentClass) 73 return false; 74 75 jQuery(this).children().click(function () { 76 return false; 77 }); 78 jQuery(this).children().children().css("cursor", "default"); 79 }); 80 } 81} 82 83function disableLink($) { 84 if (!fifuImageVars.fifu_woo_lbox_enabled) { 85 firstParentClass = ''; 86 parentClass = ''; 87 jQuery('figure.woocommerce-product-gallery__wrapper').find('div.woocommerce-product-gallery__image').each(function (index) { 88 parentClass = jQuery(this).parent().attr('class').split(' ')[0]; 89 if (!firstParentClass) 90 firstParentClass = parentClass; 91 92 if (parentClass != firstParentClass) 93 return false; 94 95 jQuery(this).children().attr("href", ""); 96 }); 97 } 98} 99 100jQuery(document).click(function ($) { 101 fifu_fix_gallery_height(); 102}) 103 104function fifu_fix_gallery_height() { 105 if (fifuImageVars.fifu_is_flatsome_active) { 106 mainImage = jQuery('.woocommerce-product-gallery__wrapper div.flickity-viewport').find('img')[0]; 107 if (mainImage) 108 jQuery('.woocommerce-product-gallery__wrapper div.flickity-viewport').css('height', mainImage.clientHeight + 'px'); 109 } 110}
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.