1jQuery( function($) { 2 3 'use strict'; 4 5 // Stops Products_infos at Footer 6 7 setTimeout(function(){ 8 if($(".single-product .product .product_infos .cart .StripeElement").children().length > 0) { 9 $(".single-product .product .product_infos .cart").addClass("stripe-button"); 10 } 11 },1000); 12 13 function product_infos_adjust() { 14 // if product description is too long 15 var productInfosHeight = $('.product .product_content_wrapper .product_infos').length ? $('.product .product_content_wrapper .product_infos').outerHeight() : 0; 16 var productInfosPos = $('.product .product_content_wrapper .product_infos').position().top; 17 var productInfosWidth = $('.product .product_content_wrapper .product_infos').length ? $('.product .product_content_wrapper .product_infos').outerWidth() : 0; 18 var productContentWrapperOff = $('.product_content_wrapper').offset().top; 19 20 if ( (productInfosHeight > $(window).innerHeight() - productContentWrapperOff) && ($(window).width() >= 1024) ) { 21 $('.product_infos').addClass('long-description'); // product description is longer than actual viewport 22 } else { 23 $('.product_infos').css({ top: productContentWrapperOff }); 24 } 25 } 26 27 if ( ($('.product_layout_cascade').length > 0) || ($('.product_layout_scattered').length > 0) ) { 28 29 product_infos_adjust(); 30 31 // if product_infos is at at footer, stop it. 32 $(window).on( 'scroll', function() { 33 34 var windowTop = $(window).scrollTop(); 35 var footerTop = $("#site-footer").length ? $("#site-footer").offset().top : 0; 36 var productInfosOff = $('.product_infos.fixed').offset().top; 37 var productInfosH = $(".product_infos.fixed").length ? $(".product_infos.fixed").height() : 0; 38 var padding = 40; // let a distance between the product_infos and the footer 39 var productContentWrapperOff = $('.product_content_wrapper').length ? $('.product_content_wrapper').offset().top : 0; 40 41 if (windowTop + productInfosH + 200 > footerTop - padding ) { 42 43 $('.product_infos.fixed:not(.long-description)').css({ 44 top: (windowTop + productInfosH - footerTop + padding) * -1 45 }); 46 47 } else { 48 $('.product_infos.fixed:not(.long-description)').css({ 49 top : productContentWrapperOff 50 }); 51 } 52 53 }); 54 55 $(window).on( 'orientationchange', function() { 56 product_infos_adjust(); 57 }); 58 } 59 60});
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.