PageSourceSearch

https://junglueck.de/cdn/shop/t/676/assets/popup-components.js?v=65279104514268373181787208575

js junglueck.de collected 2026-10-02 07:19:26 UTC 2,908 bytes, 7 lines download raw bytes

1window.theme=window.theme||{},window.theme.scroll=window.theme.scroll||(function(){let lastScrollPosition=0,scrollEnabled=!0;return{isEnabled(){return scrollEnabled},disable:()=>{scrollEnabled=!1,lastScrollPosition=window.scrollY,document.body.style.top=-window.scrollY+"px",window.innerWidth>750&&(document.body.style.paddingRight="14px"),document.body.style.position="fixed",document.body.style.height="unset"},enable:()=>{scrollEnabled=!0,document.body.style.position="",document.body.style.top="",document.body.style.paddingRight="",document.body.style.height="",window.scrollTo({top:lastScrollPosition,behavior:"instant"})}}})();class Popup extends HTMLElement{constructor(){super()}connectedCallback(){this.addEventListener("click",e=>{e.target==this&&this.close()})}isOpen(){return this.hasAttribute("open")}open(){this.setAttribute("open",!0)}close(){this.removeAttribute("open")}toggle(){this.isOpen()?this.close():this.open()}static get observedAttributes(){return["open"]}attributeChangedCallback(property,oldValue,newValue){if(oldValue!==newValue){if(property==="open"){this.isOpen()?(window.theme.scroll.disable(),this.dispatchEvent(new CustomEvent("opened")),console.warn(`[${this.tagName}] Disabled scroll.`)):(window.theme.scroll.enable(),this.dispatchEvent(new CustomEvent("closed")),console.warn(`[${this.tagName}] Enabled scroll.`));return}this[property]=newValue}}}customElements.define("pop-up",Popup);class PopupButton extends HTMLElement{constructor(){super()}connectedCallback(){this.addEventListener("click",e=>{e.preventDefault();const target=document.getElementById(this.getAttribute("for"));if(!target){console.warn(`[${this.tagName}] Target not found.`);return}if(!["POP-UP","THEME-ALERT","CART-DRAWER","ATC-SUCCESS-MODAL"].includes(target.tagName)){console.warn(`[${this.tagName}] Invalid target.`);return}target.toggle()})}static get observedAttributes(){return[]}attributeChangedCallback(property,oldValue,newValue){oldValue!==newValue&&(this[property]=newValue)}}customElements.define("pop-up-button",PopupButton);class ThemeAlert extends Popup{constructor(){super()}}customElements.define("theme-alert",ThemeAlert),window.theme=window.theme||{},window.theme.alert=(message,options={button:{label:"Close",class:"btn btn--primary"},container:{class:"flex col gap-small spacing-m"}})=>{const elementId=`alert-${crypto.randomUUID()}`,alertElement=document.createElement("theme-alert");alertElement.setAttribute("id",elementId),alertElement.innerHTML=`
2    <div class="${options.container.class}">
3      <p>${message}</p>
4      <pop-up-button class="${options.button.class}" for="${elementId}">${options.button.label}</pop-up-button>
5    </div>
6  `,document.body.appendChild(alertElement),alertElement.addEventListener("closed",()=>{alertElement.remove()}),alertElement.open()};
7//# sourceMappingURL=/cdn/shop/t/676/assets/popup-components.js.map?v=65279104514268373181787208575

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.