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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2001		}2002 2003		if (isMobileOneRow) {2004			const isPublishedMode = t_catalog__isPublishedMode();2005			if (gridContainer && isPublishedMode) {2006				if (2007					window.lazy === 'y' ||2008					// TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)2009					// @ts-expect-error ST-2949_32010					document.getElementById('allrecords').getAttribute('data-tilda-lazy') === 'yes'2011				) {2012
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
t_catalog_onFuncLoad('t_lazyload_update', function () {
2013 t_onFuncLoad('t_throttle', function () {
2014 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
2015 // @ts-expect-error ST-2949_3
2016 gridContainer.addEventListener(
2017 'scroll',
2018 t_throttle(function () {
2019 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
2020 // @ts-expect-error ST-2949_4
2021 t_lazyload_update();
2022 })
2023 );
2024 });
2025 });
2026 }
2027 }
2028 }
2029
2030 if (showRelevants) {
2031 if (gridContainer instanceof HTMLElement) gridContainer.style.opacity = '1';
2032 var blocksInRowForRelevant = 4;
2033 if (options.relevants_slider && (productsArr.length > blocksInRowForRelevant || window.innerWidth <= 960)) {
2034 t_catalog_onFuncLoad('t_sldsInit', function () {
2035 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2036 // @ts-expect-error ST-2949_5
2037 t_sldsInit((relevantsOpts && relevantsOpts.container) || recid + ' .js-catalog-relevants-grid-cont');
2038 });
2039 }
2040 }
2041
2042 if (options.itemsAnim && options.previewmode) {
2043 t_catalog_onFuncLoad('t_animate__startAnimation', function () {
2044 t_animate__startAnimation();
2045 });
2046 }
2047
2048 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2049 // @ts-expect-error ST-2949_1
2050 gridContainer.style.height = '';
2051
2052 t_catalog_triggerEvent(document.body, 'twishlist_addbtn');
2053 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2054 // @ts-expect-error ST-2949_5
2055 t_catalog_triggerEvent(gridContainer, 'tStoreRendered');
2056 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2057 // @ts-expect-error ST-2949_1
2058 window.tCatalogProductsRequested = false;
2059 }
2060
2061 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2062 // @ts-expect-error ST-2949_2
2063 function onError(error) {
2064 // Сбрасываем флаг при ошибке для повторной попытки загрузки
2065 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2066 // @ts-expect-error ST-2949_1
2067 delete window.tCatalogFirstLoadStates[recid];
2068 // @ts-expect-error ST-2949_1
2069 if (window.t_catalog_endpoint.indexOf('store.tilda') !== -1) {
2070 t_catalog_changeEndpoint(error, function () {
2071 // повтор того же запроса: флаг должен дожить до него
2072 options.skipFiltersInit = skipFiltersInit;
2073 t_catalog_loadProducts(method, recid, options, slice, relevantsOpts);
2074 });
2075 } else {
2076 // show more button
2077 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
2078 // @ts-expect-error ST-2949_3
2079 var loadMoreBtn = rec.querySelector('.js-catalog-load-more-btn');
2080 if (loadMoreBtn) {
2081 loadMoreBtn.classList.remove('t-btn_sending');
2082 }
2083
2084 // check internet connection
2085 var ts_delta = Date.now() - ts;
2086 if (xhr.status === 0 && ts_delta < 100) {
2087 console.error('Request error (get store products). Please check internet connection...');
2088 }
2089 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2090 // @ts-expect-error ST-2949_1
2091 window.tCatalogProductsRequested = false;
2092
2093 t_catalog__hidePreloader(recid);
2094
2095 // show error
2096 var el_errorBox = t_catalog_get_errorBox(
2097 options,
2098 'Request timeout (40s). Please check internet connection and <a href="javascript:window.location.reload();" style="text-decoration:underline">reload the page</a>. If the situation has not changed, please contact support <a href="mailto:team@tilda.cc?subject=Unable to get a catalog" style="text-decoration:underline">team@tilda.cc</a>.'
2099 );
2100 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
Предыдущие 100 строкСледующие 100 строк