PageSourceSearch

https://www.dentaldirect.co.uk/cdn/shop/t/31/assets/custom.js?v=171371536564803318491790148294

js dentaldirect.co.uk collected 2026-10-10 00:08:30 UTC 6,232 bytes, 16 lines download raw bytes

1document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".variant-quantity .quantity-selector--minus").forEach(function(element){element.off("click keydown");const theQuantitySelector=element.closest("quantity-selector"),theInput=theQuantitySelector.querySelector(".quantity-selector--input");element.on("click keydown",t=>{theInput.value>0&&(theInput.value=theInput.value-1,window.trigger("theme:product:"+theQuantitySelector.dataset.id+":quantityChanged"))})})}),window.newCustomerAccountsEnabled=!0,customElements.whenDefined("shopify-forms-embed").then(()=>{const observer=new MutationObserver(()=>{const widget=document.querySelector("shopify-forms-embed");if(widget){observer.disconnect();const shadowRoot=widget.shadowRoot,sheet=new CSSStyleSheet;sheet.replaceSync(`
2            #form-container-ref :is(input[type="text"], input[type="email"], input[type="tel"], textarea, button[type="button"]) {
3                font-size: 13px;
4                letter-spacing: 2px;
5            }
6            #form-container-ref button[type="submit"] {
7                border-radius: 3px;
8                font-size: 16px;
9                letter-spacing: 1px;
10                line-height: 1;
11            }
12            #form-container-ref form > div:first-child :is(input, textarea) {
13                margin-top: 1px;
14            }
15        `),shadowRoot.adoptedStyleSheets.push(sheet)}});observer.observe(document.body,{childList:!0,subtree:!0})}),customElements.whenDefined("cart-element").then(()=>{const Cart=customElements.get("cart-element");Cart.addItems=async function(options={},openDrawer=!1){const response=await fetch(`${Shopify.routes.cart_add}.js`,options);if(!response.ok){const errorData=await response.json(),error=new Error(errorData.message||response.statusText);throw error.code=errorData.status,error.description=errorData.description,error.response=errorData,Cart.forceRefresh(),openDrawer&&Cart.openDrawer(openDrawer),error}const data=await response.json(),{id,items,quantity,sections}=data;items?items.forEach(({id:id2,quantity:quantity2})=>Cart.updateBasket(id2,quantity2)):id&&quantity&&Cart.updateBasket(id,quantity),openDrawer&&Cart.openDrawer(openDrawer);const totalItems=Object.values(Cart.basket).reduce((acc,qty)=>acc+qty,0);return Cart.updateTotals(totalItems),Cart.updateAllHtml(sections),data},Cart.forceRefresh=async function(){const cartData=await(await fetch(`${Shopify.routes.cart}.js`)).json();Cart.fillBasket(cartData.items),Cart.updateTotals(cartData.item_count);const sectionsData=await(await fetch(`${Shopify.routes.cart}?sections=${Cart.sections}`)).json();return Cart.updateAllHtml(sectionsData),cartData}});const nav=document.querySelector(".header--primary-nav");if(nav){const updateNav=()=>{document.documentElement.style.setProperty("--nav--height",`${nav.offsetHeight}px`)};updateNav(),new ResizeObserver(updateNav).observe(nav)}document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-search-input]").forEach(input=>{const form=input.closest("form");if(!form)return;const waitForDrawerInput=(timeout=2e3)=>new Promise(resolve=>{const end=performance.now()+timeout,check=()=>{const input2=document.querySelector('[data-drawer-view="search"] #search_input');input2||performance.now()>end?resolve(input2):requestAnimationFrame(check)};check()}),openDrawer=async()=>{const target=document.querySelector('[data-drawer-view="search"] #search_input');return target||(window.scrollY>0&&window.scrollTo(0,0),window.trigger("theme:drawer:open",{side:"top",view:"search",trigger:input}),waitForDrawerInput())};["focus","click"].forEach(event=>input.addEventListener(event,openDrawer)),input.addEventListener("input",async()=>{const target=await openDrawer();target&&(target.value=input.value,target.dispatchEvent(new Event("input",{bubbles:!0})))}),form.addEventListener("focusout",()=>{requestAnimationFrame(()=>{const active=document.activeElement;form.contains(active)||document.querySelector('[data-drawer-view="search"] .drawer--root')?.contains(active)||input.value.trim()===""&&window.trigger("theme:drawer:close")})}),form.addEventListener("submit",e=>{e.preventDefault();const query=input.value.trim();query&&(window.location.href=`/search?type=product&q=${encodeURIComponent(query)}*`)})})}),customElements.whenDefined("element-relocator").then(()=>{const ElementRelocator=customElements.get("element-relocator");class ResponsiveElementRelocator extends ElementRelocator{connectedCallback(){const selector=this.getAttribute("data-move-into");this.element_to_move_into=document.querySelector(selector),this.element_to_move=this.firstElementChild,!(!this.element_to_move_into||!this.element_to_move)&&(this.mediaQuery=this.getMediaQuery(),this.update=this.update.bind(this),this.update(),this.mediaQuery&&this.mediaQuery.addEventListener("change",this.update))}disconnectedCallback(){this.mediaQuery&&this.mediaQuery.removeEventListener("change",this.update),super.disconnectedCallback()}getMediaQuery(){switch(this.dataset.moveMq){case"small":return window.matchMedia("(max-width: 767px)");case"medium-large":return window.matchMedia("(min-width: 768px)");default:return null}}update(){const shouldMove=!this.mediaQuery||this.mediaQuery.matches;requestAnimationFrame(()=>{shouldMove?this.element_to_move_into.replaceChildren(this.element_to_move):this.firstElementChild!==this.element_to_move&&this.appendChild(this.element_to_move)})}}customElements.define("element-relocator-responsive",ResponsiveElementRelocator)}),document.addEventListener("DOMContentLoaded",()=>{const select=document.getElementById("sort-select");if(!select)return;const radios=document.querySelectorAll('.filter--form input[name="sort_by"]'),syncSelect=()=>{const checked=[...radios].find(r=>r.checked);select.value=checked?checked.value:"relevance"};select.addEventListener("change",()=>{const radio=[...radios].find(r=>r.value===select.value);radio&&radio.nextElementSibling.click()}),document.addEventListener("click",e=>
15{(e.target.closest(".navigation--active-clear")||e.target.closest('.navigation--active-tag[data-type="sort"]'))&&requestAnimationFrame(syncSelect)})});
16//# sourceMappingURL=/cdn/shop/t/31/assets/custom.js.map?v=171371536564803318491790148294

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.