1;(function ($, window, undefined) { 2 'use strict'; 3 4 $(document).ready(function () { 5 // Enable "Add to cart" for variable products when a valid variation is selected 6 $('body') 7 .on('found_variation', '.variations_form', function () { 8 $(this) 9 .find('.single_add_to_cart_button') 10 .prop('disabled', false) 11 .removeAttr('disabled') 12 .removeClass('disabled wc-variation-selection-needed'); 13 }) 14 .on('reset_data', '.variations_form', function () { 15 $(this) 16 .find('.single_add_to_cart_button') 17 .prop('disabled', true) 18 .attr('disabled', 'disabled'); 19 }); 20 21 // Force initial state on load if a variation is already preselected 22 $('.variations_form').trigger('check_variations'); 23 24 $('.toggle-menu').click(function () { 25 // $('.mobile-menu .mobile-menu').toggle(); 26 }); 27 28 // Slick banner slider 29 if ($.fn.slick) { 30 $('.banner-sliders').slick({ 31 infinite: true, 32 centerMode: true, 33 centerPadding: '0%', 34 slidesToShow: 1, 35 arrows: true, 36 autoplay: true, 37 autoplaySpeed: 4000, 38 responsive: [ 39 { 40 breakpoint: 1240, 41 settings: { 42 centerPadding: '0%', 43 }, 44 }, 45 { 46 breakpoint: 1024, 47 settings: { 48 centerPadding: '0px', 49 slidesToShow: 1, 50 }, 51 }, 52 ], 53 }); 54 } else { 55 console.warn('Slick carousel is not loaded'); 56 } 57 58 // Add +/- buttons around quantity inputs (only if not already present) 59 $('.wakefield-cart .quantity').each(function () { 60 const $wrap = $(this); 61 62 // Avoid duplicates if markup already has plus/minus controls 63 if ($wrap.find('a.minus').length === 0) { 64 $wrap.find('input.qty').before('<a href="#" class="minus">-</a>'); 65 } 66 if ($wrap.find('a.plus').length === 0) { 67 $wrap.find('input.qty').after('<a href="#" class="plus">+</a>'); 68 } 69 }); 70 71 // Quantity +/- handler (triggers Woo change events and respects min/max) 72 $('body').on('click', '.wakefield-cart .minus, .wakefield-cart .plus', function (e) { 73 e.preventDefault(); 74 75 const $qty = $(this).closest('.quantity').find('input.qty'); 76 const current = parseInt($qty.val(), 10) || 1; 77 const min = parseInt($qty.attr('min'), 10) || 1; 78 79 const maxAttr = $qty.attr('max'); 80 const max = maxAttr ? parseInt(maxAttr, 10) : null; 81 82 let next = current + ($(this).hasClass('plus') ? 1 : -1); 83 if (next < min) next = min; 84 if (max !== null && !Number.isNaN(max) && next > max) next = max; 85 86 $qty.val(next).trigger('input').trigger('change'); 87 }); 88 89 // Owl carousel
90 if ($.fn.owlCarousel) { 91 $('.oth-carousel').owlCarousel({ 92 items: 4, 93 navigation: true, 94 itemsTablet: [768, 2], 95 itemsMobile: [767, 1], 96 }); 97 } 98 99 // Read more toggle 100 $('.expand_readmore').click(function () { 101 $(this).toggleClass('active'); 102 const id = $(this).data('id'); 103 $('#' + id).slideToggle(); 104 return false; 105 }); 106 107 // Match height 108 if ($.fn.matchHeight) { 109 $('.match_height').matchHeight({ byRow: true }); 110 } 111 }); 112})(jQuery, window);
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.