Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
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
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
option.addEventListener('click', optionClickEvent);
8913 });
8914
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');
8919
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');
8923 }
8924 };
8925 Array.prototype.forEach.call(['click', 'outsideCustomDropdown'], function (event) {
8926 document.removeEventListener(event, clickOutsideEvent);
8927 document.addEventListener(event, clickOutsideEvent);
8928 });
8929 }
8930 );
8931
8932 function removeActiveClass(option) {
8933 option.classList.remove('t-product__option-item_active');
8934 }
8935}
8936
8937function t_store_option_handleOnChange(product) {
8938 var editionOptionEvent = function () {
8939 var el_control = this.closest('.js-product-edition-option');
8940 if (el_control) {
8941 t_store_triggerEvent(el_control, 'change');
8942 }
8943 t_store_triggerEvent(product, 'tStoreVariantChange');
8944 };
8945
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);
8951 }
8952 );
8953}
8954
8955function t_store_unescapeHtml(str) {
8956 var textArea = document.createElement('textarea');
8957 textArea.innerHTML = str;
8958 return textArea.value;
8959}
8960
8961function t_store_onFuncLoad(funcName, okFunc, time) {
8962 if (typeof window[funcName] === 'function') {
8963 okFunc();
8964 } else {
8965 var startTime = Date.now();
8966 var error = new Error(funcName + ' is undefined');
8967 var callbackError = function () {
8968 throw error;
8969 };
8970 setTimeout(function checkFuncExist() {
8971 var currentTime = Date.now();
8972 if (typeof window[funcName] === 'function') {
8973 okFunc();
8974 return;
8975 }
8976 if (
8977 document.readyState === 'complete' &&
8978 currentTime - startTime > 7000 &&
8979 typeof window[funcName] !== 'function'
8980 ) {
8981 callbackError();
8982 }
8983 setTimeout(checkFuncExist, time || 100);
8984 });
8985 }
8986}
8987
8988/**
8989 * Convert a hex color value to an RGB array
8990 *
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
8993 **/
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;
8999 });
9000
Предыдущие 100 строкСледующие 100 строк