PageSourceSearch

https://isleofbarradistillers.com/cdn/shop/t/8/assets/product-media-gallery.js?v=54664594822675016631772451262

js isleofbarradistillers.com collected 2026-10-02 12:46:00 UTC 8,954 bytes, 2 lines download raw bytes

1if(!window.isQuickAddModal){let pauseGalleryMedia2=function(){var mediaElements=document.querySelectorAll(".product-video-not-autoplay video");mediaElements.forEach(function(media){media.pause()}),document.querySelectorAll(".product-media-external-media").forEach(videoContainer=>{const iframe=videoContainer.querySelector("iframe");if(iframe&&iframe.contentWindow){const message=JSON.stringify({event:"command",func:"pauseVideo",args:""});iframe.contentWindow.postMessage(message,"*")}}),document.querySelectorAll(".external-media-iframe-container").forEach(videoContainer=>{const iframe=videoContainer.querySelector("iframe");if(iframe&&iframe.contentWindow){const message=JSON.stringify({event:"command",func:"pauseVideo",args:""});iframe.contentWindow.postMessage(message,"*")}}),document.querySelectorAll(".external-media-vimeo-iframe-container").forEach(videoContainer=>{const iframe=videoContainer.querySelector("iframe");iframe&&iframe.contentWindow&&iframe.contentWindow.postMessage('{"method":"pause"}',"*")})},changeSlide2=function(thumbnail,index){const thumbnails=document.querySelectorAll(".gallery-slider--thumbnail"),slidesContainer2=document.getElementById("SlidesCon"),slides=document.getElementsByClassName("product-media-image");if(slidesContainer2){index>
1slides.length&&(index=1),index<1&&(index=slides.length),thumbnails.forEach(item=>{item.classList.remove("active")}),thumbnail.classList.add("active"),pauseGalleryMedia2();const slideWidth=slidesContainer2.offsetWidth;slidesContainer2.scrollLeft=(index-1)*slideWidth}},handleScroll2=function(){const slidesContainer2=document.getElementById("SlidesCon"),slideWidth=slidesContainer2.offsetWidth,scrollPosition=slidesContainer2.scrollLeft,thumbnails=document.getElementsByClassName("gallery-slider--thumbnail");if(slidesContainer2){const index=Math.round(scrollPosition/slideWidth)+1;pauseGalleryMedia2();for(var i=0;i<thumbnails.length;i++)thumbnails[i].classList.remove("active"),thumbnails[i].getAttribute("data-slide-index")==index&&thumbnails[i].classList.add("active")}},sliderArrows2=function(){const leftArrow=document.querySelector(".gallery-slider-arrows .slider-arrow-left"),rightArrow=document.querySelector(".gallery-slider-arrows .slider-arrow-right"),dtslidesContainer=document.getElementById("SlidesCon");if(!leftArrow||!rightArrow||!dtslidesContainer)return;let slideWidth=Math.round(dtslidesContainer.offsetWidth);window.addEventListener("resize",()=>{slideWidth=Math.round(dtslidesContainer.offsetWidth)});function updateArrowStates(){dtslidesContainer.scrollLeft<=0?leftArrow.classList.add("deactive"):leftArrow.classList.remove("deactive"),dtslidesContainer.scrollLeft+dtslidesContainer.clientWidth>=dtslidesContainer.scrollWidth?rightArrow.classList.add("deactive"):rightArrow.classList.remove("deactive")}leftArrow.addEventListener("click",()=>{dtslidesContainer.scrollBy({left:-slideWidth,behavior:"smooth"}),pauseGalleryMedia2(),setTimeout(updateArrowStates,500)}),rightArrow.addEventListener("click",()=>{dtslidesContainer.scrollBy({left:slideWidth,behavior:"smooth"}),pauseGalleryMedia2(),setTimeout(updateArrowStates,500)}),dtslidesContainer.addEventListener("scroll",updateArrowStates),updateArrowStates()},openModal2=function(){document.getElementById("galModal").classList.add("open"),document.body.classList.add("body-lock-scroll"),setModalZoomToggle2()},closeModal2=function(){document.getElementById("galModal").classList.remove("open"),document.body.classList.remove("body-lock-scroll"),setTimeout(()=>{removeZoomLevel2()},500)},currentSlide2=function(n){showSlides2(slideIndex=n),setActiveThumbnail2(n)},showSlides2=function(n){var i,slides=document.getElementsByClassName("galSlides");for(n>slides.length&&(slideIndex=1),n<1&&(slideIndex=slides.length),i=0;i<slides.length;i++)slides[i].style.display="none";slides[slideIndex-1].style.display="block"},setActiveThumbnail2=function(slideIndex2){for(var thumbnails=document.getElementsByClassName("lightbox-thumbnail"),i=0;i<thumbnails.length;i++)thumbnails[i].classList.remove("lightbox-thumbnail-active"),thumbnails[i].getAttribute("data-slide-index")==slideIndex2&&thumbnails[i].classList.add("lightbox-thumbnail-active")},thumbnailsScroll2=function(){const scroller=document.querySelector(".gst-scroller"),thumbnails=document.querySelectorAll(".gallery-slider--thumbnail");if(!scroller||thumbnails.length===0)return;const isHorizontal=scroller.classList.contains("pos-bottom");thumbnails.forEach((thumb,index)=>{thumb.addEventListener("click",()=>{const next=thumbnails[index+1],prev=thumbnails[index-1];if(isHorizontal){const thumbWidth=thumb.offsetWidth,scrollerLeft=scroller.scrollLeft,scrollerRight=scrollerLeft+scroller.clientWidth;if(next&&next.offsetLeft>=scrollerRight-10){scroller.scrollBy({left:thumbWidth+10,behavior:"smooth"});return}
1prev&&prev.offsetLeft<scrollerLeft+10&&scroller.scrollBy({left:-(thumbWidth+10),behavior:"smooth"})}else{const thumbHeight=thumb.offsetHeight,buffer=8,scrollerTop=scroller.scrollTop,scrollerBottom=scrollerTop+scroller.clientHeight;if(next&&next.offsetTop>=scrollerBottom-buffer){scroller.scrollBy({top:thumbHeight+buffer,behavior:"smooth"});return}prev&&prev.offsetTop<scrollerTop+buffer&&scroller.scrollBy({top:-(thumbHeight+buffer),behavior:"smooth"})}})})},modalThumbnailsScroll2=function(){const scroller=document.querySelector(".modal-thumbs-track-scroller"),parentOfScroller=document.querySelector(".modal-thumbs-track-outer"),thumbnails=document.querySelectorAll(".lightbox-thumbnail");if(!scroller||thumbnails.length===0)return;const isHorizontal=parentOfScroller.classList.contains("zoom-thumbnails-position-desktop-bottom");thumbnails.forEach((thumb,index)=>{thumb.addEventListener("click",()=>{const next=thumbnails[index+1],prev=thumbnails[index-1];if(isHorizontal){const thumbWidth=thumb.offsetWidth,scrollerLeft=scroller.scrollLeft,scrollerRight=scrollerLeft+scroller.clientWidth;if(next&&next.offsetLeft>=scrollerRight-6){scroller.scrollBy({left:thumbWidth+6,behavior:"smooth"});return}
1prev&&prev.offsetLeft<scrollerLeft+6&&scroller.scrollBy({left:-(thumbWidth+6),behavior:"smooth"})}else{const thumbHeight=thumb.offsetHeight,buffer=6,scrollerTop=scroller.scrollTop,scrollerBottom=scrollerTop+scroller.clientHeight;if(next&&next.offsetTop>=scrollerBottom-buffer){scroller.scrollBy({top:thumbHeight+buffer,behavior:"smooth"});return}prev&&prev.offsetTop<scrollerTop+buffer&&scroller.scrollBy({top:-(thumbHeight+buffer),behavior:"smooth"})}})})},resetZoomLevel2=function(){const modalZoomed=document.querySelector(".modal-zoomed");if(!modalZoomed||!modalZoomed.classList.contains("modal-zoom-toggle"))return!1;modalZoomed.classList.remove("gallery-mega-zoom")},removeZoomLevel2=function(){const zoomedElement=document.querySelector(".modal-zoom-toggle");zoomedElement&&zoomedElement.classList.contains("gallery-mega-zoom")&&zoomedElement.classList.remove("gallery-mega-zoom")},changeModalSlide2=function(thumb,index){const thumbs=document.querySelectorAll(".lightbox-thumbnail"),slidesContainer2=document.getElementById("modalSlidesContainer"),slides=document.getElementsByClassName("galSlides");index>
1slides.length&&(index=1),index<1&&(index=slides.length),thumbs.forEach(item=>{item.classList.remove("lightbox-thumbnail-active")}),thumb.classList.add("lightbox-thumbnail-active"),pauseGalleryMedia2(),resetZoomLevel2(),setImageToTop2();for(let i=0;i<slides.length;i++)slides[i].style.display="none";slides[index-1].style.display="block"},toggleZoom2=function(event){const parentModal=event.target.closest(".modal-zoom-toggle");parentModal&&parentModal.classList.toggle("gallery-mega-zoom")},setModalZoomToggle2=function(){document.querySelectorAll(".modal-zoom-toggle .modal-content .product-media--image").forEach(image=>{image.removeEventListener("click",toggleZoom2),image.addEventListener("click",toggleZoom2)})},setImageToTop2=function(event){const parentModal=document.querySelector(".modal-zoom-no-toggle");if(parentModal){const modalContent=parentModal.querySelector(".modal-content");modalContent&&(modalContent.scrollTop=0)}};var pauseGalleryMedia=pauseGalleryMedia2,changeSlide=changeSlide2,handleScroll=handleScroll2,sliderArrows=sliderArrows2,openModal=openModal2,closeModal=closeModal2,currentSlide=currentSlide2,showSlides=showSlides2,setActiveThumbnail=setActiveThumbnail2,thumbnailsScroll=thumbnailsScroll2,modalThumbnailsScroll=modalThumbnailsScroll2,resetZoomLevel=resetZoomLevel2,removeZoomLevel=removeZoomLevel2,changeModalSlide=changeModalSlide2,toggleZoom=toggleZoom2,setModalZoomToggle=setModalZoomToggle2,setImageToTop=setImageToTop2;const slidesContainer=document.getElementById("SlidesCon");slidesContainer&&slidesContainer.addEventListener("scroll",function(){handleScroll2()}),handleScroll2(),document.addEventListener("DOMContentLoaded",sliderArrows2),thumbnailsScroll2(),modalThumbnailsScroll2()}
2//# sourceMappingURL=/cdn/shop/t/8/assets/product-media-gallery.js.map?v=54664594822675016631772451262

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.