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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
4001			if (window.history.state.productData) {4002				var productPopupData = window.history.state.productData;4003				var recidFromHistory = productPopupData.recid,4004					optsFromHistory = productPopupData.opts,4005					productObjFromHistory = productPopupData.productObj,4006					isRelevantsShowFromHistory = productPopupData.isRelevantsShow;4007				t_store_openProductPopup(4008					recidFromHistory,4009					optsFromHistory,4010					productObjFromHistory,4011					isRelevantsShowFromHistory,
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
4012
true
4013 );
4014 } else {
4015 t_store_closePopup(true, recid, opts);
4016 }
4017 } else {
4018 t_store_closePopup(true, recid, opts);
4019 }
4020 };
4021}
4022
4023/**
4024 * Enables lazy loading of images in a product popup when the user scrolls the popup.
4025 *
4026 * @param {string} recid - The ID of the product whose popup to enable lazy loading in.
4027 */
4028function t_store_popup_updLazyOnScroll(recid) {
4029 // need to update lazy on scroll in popup
4030 var scrollContainer = document.querySelector('#rec' + recid + ' .t-popup');
4031 var curMode = document.getElementById('allrecords').getAttribute('data-tilda-mode');
4032
4033 if (scrollContainer && curMode !== 'edit' && curMode !== 'preview') {
4034 t_onFuncLoad('t_throttle', function () {
4035 scrollContainer.addEventListener(
4036 'scroll',
4037 t_throttle(function () {
4038 t_store_onFuncLoad('t_lazyload_update', function () {
4039 t_lazyload_update();
4040 });
4041 })
4042 );
4043 });
4044 }
4045}
4046
4047/**
4048 * Updates the URL and browser history to reflect the currently open product popup.
4049 *
4050 * @param {string} recid - The ID of the product whose popup is open.
4051 * @param {Object} product - An object containing data for the product whose popup is open.
4052 * @param {boolean} isRelevantsShow - Whether the product popup is showing relevant products.
4053 * @param {TildaStoreOptions} options - An object containing options for the product popup.
4054 */
4055function t_store_changeUrl(recid, product, isRelevantsShow, options) {
4056 var isiOS = /iPhone|iPad|iPod/i.test(navigator.userAgent);
4057 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
4058 var curUrl = window.location.href;
4059 var productData = {
4060 productObj: product,
4061 opts: options,
4062 isRelevantsShow: isRelevantsShow,
4063 recid: recid,
4064 };
4065 var newUrl;
4066
4067 var newPageTitle = document.title + ' – ' + product.title;
4068 if (curUrl.indexOf('/tproduct/') < 0 && curUrl.indexOf('%2Ftproduct%2F') < 0) {
4069 newUrl = t_store_generateUrl(product);
4070 t_store_history_pushState(
4071 {
4072 productData: productData,
4073 },
4074 newPageTitle,
4075 newUrl
4076 );
4077 if (isiOS && isSafari) {
4078 document.querySelector('head link[rel="canonical"]').setAttribute('href', newUrl);
4079 document.title = newPageTitle;
4080 }
4081 } else if (isRelevantsShow) {
4082 // for relevants
4083 newUrl = t_store_generateUrl(product);
4084 t_store_history_pushState(
4085 {
4086 productData: productData,
4087 },
4088 newPageTitle,
4089 newUrl
4090 );
4091 }
4092}
4093
4094/**
4095 * Generates a URL for the given product based on its relative path.
4096 *
4097 * @param {Object} product - An object containing data for the product to generate a URL for.
4098 * @param {string} product.url - The URL of the product.
4099 * @return {string} - The generated URL for the product.
4100 */
Предыдущие 100 строкСледующие 100 строк