1require(["jquery", 'Magento_Ui/js/modal/modal'], function($, modal) { 2 3 $(document).ready(function () { 4 5 /* Sitewide Banner*/ 6 let swb = $('.sitewide-banner-container'); 7 if(swb.length){ 8 $('.sitewide-banner-wrapper').append('<span class="close"></span>'); 9 } 10 swb.on('click', 'span.close',function(){ 11 swb.slideToggle(); 12 }); 13 14 15 $('.mobile-search-toggle').click(function () { 16 $(this).toggleClass('active'); 17 $('.block-search').slideToggle(); 18 19 }); 20 21 22 $('.footer-links-title').click(function () { 23 simpleRespAcc(this); 24 }); 25 26 }); //End Ready 27 28 $(document).ready(function () { 29 $('.reviews-actions').click(function(){ 30 if(!$('.data.accordion.title[aria-controls="reviews"]').hasClass('active')) { 31 $('.data.accordion.title[aria-controls="reviews"] div').click(); 32 } 33 $([document.documentElement, document.body]).animate({ 34 scrollTop: $('.block.review-add').offset().top - 50 35 }, 3000); 36 }); 37 $payOverBtn = jQuery('#bread-btn-cntnr').detach(); 38 jQuery('.catalog-product-view .box-tocart').after($payOverBtn); 39 }); 40 41 /** 42 * Simple reusable accordion for tablet/mobile 43 * @param r 44 */ 45 function simpleRespAcc(r){ 46 if ($(window).width() < 979) { 47 if ($(r).hasClass('expanded')) { 48 $(r).removeClass('expanded'); 49 $(r).next().slideUp(); 50 } else { 51 $(r).addClass('expanded'); 52 $(r).next().slideDown(); 53 } 54 } 55 } 56 57 $(document).ready(function($) { 58 var interval = setInterval(function(){ 59 if ($('body').find('.checkout-notice-wrapper').length) { 60 //setTimeout(function(){ 61 //console.log(geoplugin_countryCode()); 62 //if(geoplugin_countryCode() == 'US') { 63 $('body').find('.checkout-notice-wrapper').addClass('soHotRightNow'); 64 $('body').find('.checkout-notice-content').show(); 65 //} 66 //}, 2000); 67 clearInterval(interval); 68 } 69 },250); 70 }); 71 72 $(document).ready(function () { 73 $('.catalog-product-view .breadTooltipCustom').addClass("breadTooltipCustom-c"); 74 $('.catalog-product-view .breadTooltipCustom-c').removeClass("breadTooltipCustom"); 75 var intervalforproductfooter = setInterval(function(){ 76 if ($('body').find('.product-info-price span[data-price-type="finalPrice"] .price').length) { 77 $('.productPriceToolTip-product-footer-new').html($('.product-info-price span[data-price-type="finalPrice"] .price').html()); 78 clearInterval(intervalforproductfooter); 79 } 80 },250); 81 82 //compare height alignment 83 84 var els = jQuery('.catalog-product_compare-index .product-item-name'); 85 els.height(getTallestHeight(els)); 86 function getTallestHeight(elements) { 87 var tallest = 0, height; 88 for(i=0; i < elements.length; i++) { 89 height = jQuery(elements[i]).height(); 90 if(height > tallest){ 91 tallest = height; 92 } 93 } 94 return tallest; 95 }; 96 97 98 $(window).scroll(function() { 99 var scroll = $(window).scrollTop(); 100 var headerHeight = $('header.page-header').height(); 101 if (scroll >= headerHeight) { 102 $("html").addClass("stickyHeader"); 103 } else { 104 $("html").removeClass("stickyHeader"); 105 } 106 }); 107 108 109 }); 110 111 $(document).ready(function () { 112 // Wait a tick for menu to render 113 setTimeout(function () { 114 $('.navigation ul li a[aria-haspopup]').removeAttr('aria-haspopup'); 115 $('.section-items.nav-sections-items[role]').removeAttr('role'); 116 $('.section-item-content.nav-sections-item-content[role]').removeAttr('role'); 117 $('.section-item-content.nav-sections-item-content[aria-hidden]').removeAttr('aria-hidden'); 118 $('.section-item-content.nav-sections-item-content').removeAttr('role'); 119 $('.section-item-content.nav-sections-item-content ul li a[role]').removeAttr('role'); 120 $('.section-item-content.nav-sections-item-content ul li .mega-menu-container.ui-menu-item-wrapper[role]').removeAttr('role'); 121 $('.gallery-placeholder[data-gallery-role="gallery-placeholder"]').prepend('<span class="sr-only">Product image gallery</span>'); 122 $('.sections.nav-sections').removeAttr('aria-label'); 123 $('.sections.nav-sections').attr('aria-label', 'Main Navigation'); 124 $('.fotorama__nav-wrap.fotorama__nav-wrap--horizontal').attr('role', 'region'); 125 $('.sections.nav-sections').removeAttr('role'); 126 $('.sections.nav-sections').removeAttr('aria-label'); 127 $('.sections.nav-sections').removeAttr('aria-modal'); 128 $('.product.info.detailed .tabs-titles .data.item.title').removeAttr('aria-expanded'); 129 $('.fotorama__nav__frame.fotorama__nav__frame--thumb').removeAttr('role'); 130 $('.fotorama__nav-wrap.fotorama__nav-wrap--horizontal').removeAttr('role'); 131 $('.navigation .icon.category-icon-down-up').removeAttr('aria-hidden'); 132 $('.filter-content .filter-current').removeAttr('role'); 133 $('#layered-filter-block #narrow-by-list .filter-options-item').removeAttr('tabindex'); 134 $('.opc-summary-wrapper [data-role="focusable-start"]').removeAttr('tabindex'); 135 $('.product.info.detailed .tabs-titles div').removeAttr('tabindex'); 136 $('.fotorama__wrap .fotorama__stage').attr('role', 'region'); 137 $('.minicart-wrapper .mage-dropdown-dialog').removeAttr('aria-describedby'); 138 $('.required-step-title.active').closest('li.required-step').attr('aria-current', 'step'); 139 $('.product.info.detailed .tabs-titles div').attr('role', 'tab'); 140 141 }, 2500); 142 var checkHfcIframe = setInterval(function () { 143 var $iframe = $('#hfc-frame'); if ($iframe.length) { 144 $iframe.attr('title', 'chat iframe'); 145 clearInterval(checkHfcIframe); 146 } 147 }, 500); 148 var checkIframe = setInterval(function () { var $iframe = $('.pay-later-message iframe'); if ($iframe.length) { try { $iframe.contents().find('img').each(function () { $(this).attr('alt', 'Pay Later'); }); clearInterval(checkIframe); } catch (e) { // Wait and try again if iframe content is not ready 149 } } }, 500); 150 }); 151 152 const observer = new MutationObserver(() => { 153 $('.ui-menu.ui-widget[aria-expanded]').removeAttr('aria-expanded'); 154 }); 155 156 observer.observe(document.body, { 157 attributes: true, 158 subtree: true 159 }); 160 161 $(document).ready(function () { 162 163 function updateAriaSelected() { 164 $('.tabs-titles .data.item.title').each(function () { 165 if ($(this).hasClass('active')) { 166 $(this).attr('aria-selected', 'true'); 167 } else { 168 $(this).attr('aria-selected', 'false'); 169 } 170 }); 171 } 172 173 // Initial state 174 updateAriaSelected(); 175 176 // Update when a tab is clicked 177 $(document).on('click', '.tabs-titles .data.item.title', function () { 178 setTimeout(function () { 179 updateAriaSelected(); 180 }, 100); 181 }); 182 183 //start checkout progress bar disable attr 184 function updateProgressBarAccessibility() { 185 $('.opc-progress-bar-item').each(function () { 186 var $li = $(this); 187 var $link = $li.find('> span[role="link"]'); 188 189 if (!$link.length) { 190 return; 191 } 192 193 // Remove existing handlers before re-applying 194 $link.off('.progressAccessibility'); 195 196 if ($li.hasClass('_active')) { 197 // Active step 198 $link.attr('tabindex', '0'); 199 $link.removeAttr('aria-disabled'); 200 201 } else { 202 // Inactive step 203 $link.attr('tabindex', '-1'); 204 $link.attr('aria-disabled', 'true'); 205 206 // Prevent mouse activation 207 $link.on('click.progressAccessibility', function (e) { 208 e.preventDefault(); 209 e.stopImmediatePropagation(); 210 return false;
211 }); 212 213 // Prevent Enter / Space activation 214 $link.on('keydown.progressAccessibility', function (e) { 215 if (e.key === 'Enter' || e.key === ' ') { 216 e.preventDefault(); 217 e.stopImmediatePropagation(); 218 return false; 219 } 220 }); 221 } 222 }); 223 } 224 225 function initializeProgressBarAccessibility() { 226 var progressBar = document.querySelector('.opc-progress-bar'); 227 228 if (!progressBar) { 229 return false; 230 } 231 232 // Initial update 233 updateProgressBarAccessibility(); 234 235 // Watch for Magento/Knockout changes 236 var observer = new MutationObserver(function () { 237 updateProgressBarAccessibility(); 238 }); 239 240 observer.observe(progressBar, { 241 attributes: true, 242 attributeFilter: ['class'], 243 subtree: true 244 }); 245 246 return true; 247 } 248 249 // Checkout may not have rendered yet. 250 // Keep checking until the progress bar exists. 251 var checkoutInterval = setInterval(function () { 252 if (initializeProgressBarAccessibility()) { 253 clearInterval(checkoutInterval); 254 } 255 }, 250); 256 //end checkout progress bar disable attr 257 258 //start remove focus from hidden slick slides 259 function updateSlickAccessibility() { 260 $('.slick-slide').each(function () { 261 var $slide = $(this); 262 263 $slide.find('a').attr( 264 'tabindex', 265 $slide.hasClass('slick-active') ? '0' : '-1' 266 ); 267 }); 268 } 269 270 updateSlickAccessibility(); 271 272 $(document).on('afterChange', '.slick-slider', function () { 273 updateSlickAccessibility(); 274 }); 275 //end remove focus from hidden slick slides 276 277 }); 278 279}); 280 281 282
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.