1//Activates swiping if device is mobile 2$(document).ready(function () { 3 var detailWidth = $(window).width(); 4 if (detailWidth < 768) { 5 $('#galleryImages').removeClass('swiper-no-swiping'); 6 $('#swiperTech').removeClass('swiper-no-swiping'); 7 $('#swiperLifestyle').removeClass('swiper-no-swiping'); 8 } 9}); 10var swiper = new Swiper(".rotate-gallery", { 11 navigation: { 12 nextEl: ".swiper-button-next", 13 prevEl: ".swiper-button-prev" 14 }, 15 keyboard: { 16 enabled: true 17 }, 18 19 breakpoints: { 20 992: { 21 virtualTranslate: true, // disable transforms on desktop 22 allowTouchMove: false, // optional: no drag on desktop 23 simulateTouch: false // optional: stop click confusion 24 } 25 } 26}); 27 28// Keyboard support for gallery controls 29$(document).on('keydown', '.gallery-toggle, .swiper-button-next, .swiper-button-prev, .open-zoom-img, .close-zoom-img', function (e) { 30 if (e.key === 'Enter' || e.key === ' ') { 31 e.preventDefault(); 32 $(this).click(); 33 } 34}); 35 36//Shows more gallery images 37$(".gallery-toggle").click(function () { 38 $("#galleryImages").toggleClass("show-all"); 39 if ($(".gallery-toggle span").text() === "See More Images") { 40 $(".gallery-toggle span").text("See Fewer Images"); 41 $(".gallery-toggle img").attr("src", "resources/images/minus-black.svg"); 42 } else { 43 $(".gallery-toggle span").text("See More Images"); 44 $(".gallery-toggle img").attr("src", "resources/images/plus-black.svg"); 45 } 46}); 47 48//Size and Width Variables 49function widthError() { 50 $(".sizebox-width").addClass("outline"); 51 $("#style\\:lblMissingWidth").attr("style", "display:inline"); 52} 53function sizeError() { 54 $(".sizebox-size").addClass("outline"); 55 $("#style\\:lblMissingSize").attr("style", "display:inline"); 56} 57//Creates outline on errors and add error message 58$(document).ready(function () { 59 updateSizeAriaPressed(); 60 var skuSize = $("#style\\:lblHiddenSize").val(); 61 var skuWidth = $("#style\\:lblHiddenWidth").val(); 62 $("span#style\\:lblSelectSize").click(function () { 63 if (skuSize === '-1' && skuWidth === '-1') { 64 widthError(); 65 sizeError(); 66 } else if (skuSize === '-1' && skuWidth > 0) { 67 sizeError(); 68 } else if (skuSize > 0 && skuWidth === '-1') { 69 widthError(); 70 } 71 }); 72}); 73 74function updateSizeAriaPressed() { 75 $("a").filter(function () { 76 return $(this).find(".sizebox-size, .sizebox-width").length > 0; 77 }).each(function () { 78 $(this).attr("aria-pressed", $(this).find(".selected").length > 0 ? "true" : "false"); 79 }); 80} 81 82function resetBtn(data) { 83 var skuSize = $("#style\\:lblHiddenSize").val(); 84 var skuWidth = $("#style\\:lblHiddenWidth").val(); 85 if (data.status === "success") { 86 updateSizeAriaPressed(); 87 $("span#style\\:lblSelectSize").click(function () { 88 if (skuSize === '-1' && skuWidth === '-1') { 89 widthError(); 90 sizeError(); 91 } else if (skuSize === '-1' && skuWidth > 0) { 92 sizeError(); 93 } else if (skuSize > 0 && skuWidth === '-1') { 94 widthError(); 95 } 96 }); 97 } 98} 99 100 101 102function zoomInDesktop() { 103 $("#galleryImages .swiper-slide-img").addClass("zoomed-in"); 104} 105 106function zoomOutDesktop() { 107 $("#galleryImages .swiper-slide-img").removeClass("zoomed-in"); 108} 109$(document).ready(function () { 110 var detailWidthZoom = $(window).width(); 111 if (detailWidthZoom > 768) { 112 $("#galleryImages .swiper-slide-img").each(function () { 113 // Skip zoom initialization if this slide contains a video 114 if ($(this).find('.video-wrapper').length > 0) { 115 return; 116 } 117 118 // Otherwise enable zoom 119 $(this).zoom({ 120 on: 'click', 121 onZoomIn: zoomInDesktop, 122 onZoomOut: zoomOutDesktop 123 }); 124 }); 125 $("#galleryImages .swiper-slide-img").click(function (event) { 126 $(event.target).one("mouseleave", function () { 127 $(event.target).trigger('click.zoom'); 128 return false; 129 }); 130 }); 131 } else { 132 //Centers image on initial click 133 var conHeight = $(".swiper-slide-active .swiper-slide-img").height(); 134 var conWidth = $(".swiper-slide-active .swiper-slide-img").width(); 135 var scrollDepthTop = conHeight / 2; 136 var scrollDepthLeft = conWidth / 2; 137 //Mobile Zoom Open Button 138 $(".zoom-toggle .open-zoom-img").click(function () { 139 $(".swiper-slide-active .swiper-slide-img").css('height', conHeight).addClass("dragscroll"); 140 $(".swiper-slide-active .swiper-slide-img img").removeClass("img-fluid"); 141 $("#galleryImages").addClass("swiper-no-swiping"); 142 $(".close-zoom-img").show(); 143 $(".swiper-button-next").addClass("d-none"); 144 $(".swiper-button-prev").addClass("d-none"); 145 $(this).hide(); 146 $(".swiper-slide-active .swiper-slide-img").scrollTop(scrollDepthTop); 147 $(".swiper-slide-active .swiper-slide-img").scrollLeft(scrollDepthLeft); 148 });
149 //Mobile Zoom Close Button 150 $(".zoom-toggle .close-zoom-img").click(function () { 151 scrollDepthTop = $(".swiper-slide-active .swiper-slide-img").scrollTop(); 152 scrollDepthLeft = $(".swiper-slide-active .swiper-slide-img").scrollLeft(); 153 $(".swiper-slide-active .swiper-slide-img").css('height', 'auto').removeClass("dragscroll"); 154 $(".swiper-slide-active .swiper-slide-img img").addClass("img-fluid"); 155 $("#galleryImages").removeClass("swiper-no-swiping"); 156 $(".open-zoom-img").show(); 157 $(".swiper-button-next").removeClass("d-none"); 158 $(".swiper-button-prev").removeClass("d-none"); 159 $(this).hide(); 160 }); 161 162 } 163}); 164
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.