You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
1.6 KiB
1 lines
1.6 KiB
!function(a){woodmartThemeModule.stickyAddToCart=function(){var b=a("form.cart"),c=a(".wd-sticky-btn");if(!(c.length<=0||b.length<=0||woodmartThemeModule.$window.width()<=768&&c.hasClass("mobile-off"))){var d=b.offset().top+b.outerHeight(),e=a(".scrollToTop"),f=function(){var a=woodmartThemeModule.$window.scrollTop(),b=woodmartThemeModule.$window.height(),f=woodmartThemeModule.$document.height();d<a&&a+b!==f?(c.addClass("wd-sticky-btn-shown"),e.addClass("wd-sticky-btn-shown")):(a+b===f||d>a)&&(c.removeClass("wd-sticky-btn-shown"),e.removeClass("wd-sticky-btn-shown"))};f(),woodmartThemeModule.$window.on("scroll",f),a(".wd-sticky-add-to-cart").on("click",function(b){b.preventDefault(),a("html, body").animate({scrollTop:a(".elementor-widget-woocommerce-product-title,.summary-inner .product_title").offset().top},800)}),a(".wd-sticky-btn .wd-wishlist-btn a").on("click",function(b){a(this).hasClass("added")||b.preventDefault(),a(".summary-inner > .wd-wishlist-btn a").trigger("click")}),woodmartThemeModule.$document.on("added_to_wishlist",function(){a(".wd-sticky-btn .wd-wishlist-btn a").addClass("added")}),a(".wd-sticky-btn .wd-compare-btn a").on("click",function(b){a(this).hasClass("added")||b.preventDefault(),a(".summary-inner > .wd-compare-btn a").trigger("click")}),woodmartThemeModule.$document.on("added_to_compare",function(){a(".wd-sticky-btn .wd-compare-btn a").addClass("added")}),a(".wd-sticky-btn-cart .qty").on("change",function(){a(".summary-inner .qty").val(a(this).val())}),a(".summary-inner .qty").on("change",function(){a(".wd-sticky-btn-cart .qty").val(a(this).val())})}},a(document).ready(function(){woodmartThemeModule.stickyAddToCart()})}(jQuery); |