PageSourceSearch

https://jockofuel.com/cdn/shop/t/280/assets/jf-swatch-tooltip.js?v=44712971452497613521790515819

js jockofuel.com collected 2026-10-01 13:09:42 UTC 2,293 bytes, 2 lines download raw bytes

1const SWATCH="swatches-variant-picker-component .variant-option__button-label--has-swatch";let tooltip=null,anchor=null,lastPointerType="mouse";function tooltipElement(){return tooltip||(tooltip=document.createElement("div"),tooltip.className="jf-swatch-tooltip",tooltip.setAttribute("aria-hidden","true"),document.body.append(tooltip)),tooltip}function show(swatch){const input=swatch.querySelector('input[type="radio"]');if(!(input instanceof HTMLInputElement)||!input.value)return;const tip=tooltipElement(),box=swatch.getBoundingClientRect();tip.textContent=input.value,tip.style.left=`${box.left}px`,tip.style.right="auto",tip.style.top=`${box.top}px`,tip.style.transform=`translate(calc(-50% + ${box.width/2}px), calc(-100% - 6px))`,tip.classList.add("jf-swatch-tooltip--shown"),anchor=swatch;const width=tip.getBoundingClientRect().width;width/2>box.left&&(tip.style.left=`${width/2}px`),box.right+width/2>window.innerWidth&&box.width<width&&(tip.style.left="auto",tip.style.right=`${box.width/2-width/2+5}px`)}function hide(){anchor&&(anchor=null,tooltip?.classList.remove("jf-swatch-tooltip--shown"))}function withinAnchor(node){return node instanceof Node&&!!anchor&&(anchor.contains(node)||!!tooltip?.contains(node))}function swatchOf(target){return target instanceof Element?target.closest(SWATCH):null}document.addEventListener("pointerover",event=>{if(event.pointerType!=="mouse")return;const swatch=swatchOf(event.target);swatch&&swatch!==anchor&&show(swatch)},!0),document.addEventListener("pointerout",event=>{event.pointerType!=="mouse"||!anchor||withinAnchor(event.target)&&!withinAnchor(event.relatedTarget)&&hide()},!0),document.addEventListener("pointerdown",event=>{lastPointerType=event.pointerType,event.pointerType!=="mouse"&&!withinAnchor(event.target)&&hide()},!0),document.addEventListener("click",event=>{if(lastPointerType==="mouse"||event.detail===0)return;const swatch=swatchOf(event.target);swatch&&show(swatch)}),window.addEventListener("scroll",event=>{if(!anchor)return;const scroller=event.target===document?document.documentElement:event.target;scroller instanceof Node&&scroller.contains(anchor)&&hide()},!0),window.addEventListener("resize",hide,!0);
2//# sourceMappingURL=/cdn/shop/t/280/assets/jf-swatch-tooltip.js.map?v=44712971452497613521790515819

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.