PageSourceSearch

https://www.therabody.co.uk/cdn/shop/t/5/assets/sticky-add-to-cart.js?v=92295648397671198801790792453

js therabody.co.uk collected 2026-10-06 07:01:31 UTC 2,103 bytes, 2 lines download raw bytes

1document.addEventListener("DOMContentLoaded",function(){function stickyAddToCart(event,isFocusWithin=!1){const section=document.querySelector(".custom_main_product"),quantityAddCartWrapper=document.querySelector(".sticky_add_to_cart");if(!section||!quantityAddCartWrapper){console.error("Section or Add to Cart element not found!");return}const sectionHeight=section.offsetHeight;window.scrollY>sectionHeight||isFocusWithin?quantityAddCartWrapper.classList.add("active_sticky"):quantityAddCartWrapper.classList.remove("active_sticky")}function getMainAtcButtonText(){const mainButton=document.querySelector('.product__info-wrapper .product-form__submit[name="add"] > span:first-child');return mainButton?mainButton.textContent.trim():null}function syncStickyAtcLabel(){const mainText=getMainAtcButtonText();mainText&&document.querySelectorAll('.sticky_add_to_cart .product-form__submit[name="add"] > span:first-child').forEach(stickyButton=>{stickyButton.textContent.trim()!==mainText&&(stickyButton.textContent=mainText)})}window.addEventListener("scroll",stickyAddToCart);const stickyBar=document.querySelector(".sticky_add_to_cart");stickyBar&&(stickyBar.addEventListener("focusin",function(event){stickyAddToCart(event,!0)}),stickyBar.addEventListener("focusout",stickyAddToCart));function observeMainAtcButton(){const mainButton=document.querySelector('.product__info-wrapper .product-form__submit[name="add"] > span:first-child');if(!mainButton||mainButton.dataset.stickyLabelObserved)return;mainButton.dataset.stickyLabelObserved="true",new MutationObserver(syncStickyAtcLabel).observe(mainButton,{childList:!0,characterData:!0,subtree:!0}),syncStickyAtcLabel()}stickyAddToCart(),observeMainAtcButton(),new MutationObserver(observeMainAtcButton).observe(document.documentElement,{childList:!0,subtree:!0}),typeof subscribe=="function"&&typeof PUB_SUB_EVENTS<"u"&&subscribe(PUB_SUB_EVENTS.variantChange,syncStickyAtcLabel),document.addEventListener("shopify:section:load",observeMainAtcButton)});
2//# sourceMappingURL=/cdn/shop/t/5/assets/sticky-add-to-cart.js.map?v=92295648397671198801790792453

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.