PageSourceSearch

https://www.caffeprima.co.uk/cdn/shop/t/29/assets/sticky-add-to-cart.js?v=125577450703645595911770130850

js caffeprima.co.uk collected 2026-10-08 18:33:34 UTC 3,941 bytes, 2 lines download raw bytes

1class StickyAddToCart extends HTMLElement{constructor(){super(),this._product_container=document.querySelector("[product-container]"),this._scrollToSectionButton=this.querySelector("[scroll-to-section]"),this._drawerScrollToSection=document.querySelector("drawer-component [scroll-to-section]"),this.drawerType=this.querySelector("[drawer-to-open]")?this.querySelector("[drawer-to-open]").getAttribute("drawer-to-open"):"sticky-add-to-cart-drawer",document.addEventListener("scroll",this._scrollHandler.bind(this)),this._scrollToSectionButton&&this._scrollToSectionButton.addEventListener("click",this._scrollToSection.bind(this)),this._drawerScrollToSection&&this._drawerScrollToSection.addEventListener("click",this._scrollToSection.bind(this)),document.addEventListener(_EVENT_HELPER.triggerVariantAddToCartError,e=>{this.componentState=this.getAttribute("aria-hidden"),this.componentState==="false"&&this._scrollToSection(e)})}connectedCallback(){this._product_containerOffsetTop=this._product_container.offsetTop,this._product_containerHeight=this._product_container.offsetHeight,this._totalScrollHeight=this._product_containerOffsetTop+this._product_containerHeight}_scrollHandler(){window.scrollY>this._totalScrollHeight?this.classList.add("active"):this.classList.remove("active")}_scrollToSection(e){e.preventDefault(),this.scrollTosectionElement=this._scrollToSectionButton.getAttribute("scroll-to-section")||this._drawerScrollToSection.getAttribute("scroll-to-section"),this.scrollTosectionElementOffset=document.querySelector(`[${this.scrollTosectionElement}]`).offsetTop,HELPER_UTIL.dispatchCustomEvent(_EVENT_HELPER.hideDrawer,this,{drawerType:this.drawerType}),window.scrollTo({top:this.scrollTosectionElementOffset,behavior:"smooth"})}disconnectedCallback(){document.removeEventListener("scroll",this._scrollHandler.bind(this)),this._scrollToSectionButton&&this._scrollToSectionButton.removeEventListener("click",this._scrollToSection.bind(this)),this._drawerScrollToSection&&this._drawerScrollToSection.removeEventListener("click",this._scrollToSection.bind(this))}}window.customElements.define("sticky-add-to-cart",StickyAddToCart);class StickyAddToCartContent extends HTMLElement{constructor(){super(),document.addEventListener(_EVENT_HELPER.updateStickyAddToCartContent,this._updateStickyAddToCartContent.bind(this)),this.variantList=this.querySelector("[sticky-add-to-cart-variants]"),this.addToCartButton=this.querySelector("[add-to-cart-button]"),this.sticky_bar_button=this.querySelector("[sticky-bar-button]"),this.layout_type=this.getAttribute("layout-type"),document.addEventListener(_EVENT_HELPER.updateStickyAddToCartContentUnAvailable,this._updateStickyAddToCartContentUnAvailable.bind(this))}_updateStickyAddToCartContent(e){e.detail.sticky_content.forEach(element=>{element.getAttribute("layout-type")===this.layout_type&&(this.querySelector("[sticky-add-to-cart-variants]").innerHTML=element.querySelector("[sticky-add-to-cart-variants]").innerHTML,this.querySelector("[add-to-cart-button]").innerHTML=element.querySelector("[add-to-cart-button]").innerHTML,this.togleAddToCartButton(!0))})}_updateStickyAddToCartContentUnAvailable(e){this.variantList.textContent=e.detail.variantOptions.join(", "),this.togleAddToCartButton(!1)}togleAddToCartButton(buttonEnabled){this.addToCartButton&&(buttonEnabled?this.addToCartButton.removeAttribute("disabled"):(this.addToCartButton.classList.contains("sticky-icon-button")||(this.addToCartButton.textContent=window.variantStrings.unavailable),this.addToCartButton.removeAttribute("form"),this.addToCartButton.setAttribute("disabled",!0)))}disconnectedCallback(){document.removeEventListener(_EVENT_HELPER.updateStickyAddToCartContent,this._updateStickyAddToCartContent.bind(this))}}window.customElements.define("sticky-add-to-cart-content",StickyAddToCartContent);
2//# sourceMappingURL=/cdn/shop/t/29/assets/sticky-add-to-cart.js.map?v=125577450703645595911770130850

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.