Каталог файловtilda-catalog-1.1.js
8901 'data-original'8902 );8903 8904 el_checkmark = el_selected_image.querySelector('.t-product__option-selected-checkmark');8905 el_checkmark.setAttribute('data-original', imageUrlLazyload);8906 el_checkmark.style.backgroundImage = 'none';8907 el_checkmark.style.backgroundImage = imageUrl;8908 }8909 };8910 Array.prototype.forEach.call(el_option, function (option) {8911 option.removeEventListener('click', optionClickEvent);8912
История файла и сравнение версий
option.addEventListener('click', optionClickEvent);
8915 // Close all custom dropdowns on click outside 8916 var clickOutsideEvent = function (e) { 8917 var el_clicked = e.target; 8918 var select_parent = el_select_custom.closest('.js-product-edition-option'); 8920 // If parent doesns contains target, hide options 8921 if (!select_parent.contains(el_clicked)) { 8922 el_select_custom.classList.add('t-product__option-variants_hidden'); 8925 Array.prototype.forEach.call(['click', 'outsideCustomDropdown'], function (event) { 8926 document.removeEventListener(event, clickOutsideEvent); 8927 document.addEventListener(event, clickOutsideEvent); 8932 function removeActiveClass(option) { 8933 option.classList.remove('t-product__option-item_active'); 8937function t_store_option_handleOnChange(product) { 8938 var editionOptionEvent = function () { 8939 var el_control = this.closest('.js-product-edition-option'); 8941 t_store_triggerEvent(el_control, 'change'); 8943 t_store_triggerEvent(product, 'tStoreVariantChange'); 8946 Array.prototype.forEach.call( 8947 product.querySelectorAll('.js-product-edition-option-variants'), 8948 function (editionOption) { 8949 editionOption.removeEventListener('change', editionOptionEvent); 8950 editionOption.addEventListener('change', editionOptionEvent); 8955function t_store_unescapeHtml(str) { 8956 var textArea = document.createElement('textarea'); 8957 textArea.innerHTML = str; 8958 return textArea.value; 8961function t_store_onFuncLoad(funcName, okFunc, time) { 8962 if (typeof window[funcName] === 'function') { 8965 var startTime = Date.now(); 8966 var error = new Error(funcName + ' is undefined'); 8967 var callbackError = function () { 8970 setTimeout(function checkFuncExist() { 8971 var currentTime = Date.now(); 8972 if (typeof window[funcName] === 'function') { 8977 document.readyState === 'complete' && 8978 currentTime - startTime > 7000 && 8979 typeof window[funcName] !== 'function' 8983 setTimeout(checkFuncExist, time || 100); 8989 * Convert a hex color value to an RGB array 8991 * @param {string} hex - The hex value of the color you want to convert. 8992 * @returns {Array<number>|null} The RGB values of the hex color 8994function t_store_hexToRgb(hex) { 8995 // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") 8996 var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; 8997 var expandedHex = hex.replace(shorthandRegex, function (m, r, g, b) { 8998 return r + r + g + g + b + b;