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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
201			// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)202			// @ts-expect-error ST-2949_1203			Object.keys(window.tCatalogInit).length > BLOCKS_COUNT_FOR_LAZY_INIT;204 205		if (shouldUseLazyObserver) {206			// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)207			// @ts-expect-error ST-2949_1208			window.tCatalogInit[recid] = 'lazy';209			var recordObserver = new IntersectionObserver(210				function (entries, observer) {211					entries.forEach(function (entry) {
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
212
if (entry.isIntersecting) {
213 var target = entry.target;
214 observer.unobserve(target);
215 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
216 // @ts-expect-error ST-2949_1
217 if (window.tCatalogInit[recid] === 'lazy') {
218 t_catalog_lazyInit(recid, options);
219 // @ts-expect-error ST-2949_1
220 window.tCatalogInit[recid] = true;
221 }
222 }
223 });
224 },
225 {
226 rootMargin: '150px 0px',
227 }
228 );
229 recordObserver.observe(rec);
230 } else {
231 t_catalog_lazyInit(recid, options);
232 }
233 });
234}
235
236// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
237// @ts-expect-error ST-2949_2
238function t_catalog_lazyInit(recid, opt) {
239 var options = opt || {};
240 var rec = document.getElementById('rec' + recid);
241 var isSnippet =
242 document.getElementById('allrecords') !== document.querySelector('.t-catalog__product-snippet') &&
243 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
244 // @ts-expect-error ST-2949_3
245 document.getElementById('allrecords').contains(document.querySelector('.t-catalog__product-snippet'));
246 // ST-2522: сбрасывает внешние отступы кнопок в карточке товара.
247 // Класс только если в блоке есть новый шаблон карточки — старые опубликованные страницы его не получают.
248 if (t_catalog__getCardTemplateNode(rec)) {
249 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
250 // @ts-expect-error ST-2949_3
251 const catalogRoot = rec.querySelector('.t-catalog');
252 if (catalogRoot) {
253 catalogRoot.classList.add('t-catalog_card-template');
254 }
255 }
256
257 if (!isSnippet) {
258 t_catalog_initRouting();
259 }
260
261 if (!window.tCatalogDict) {
262 t_catalog__setGlobalDictObj();
263 }
264
265 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
266 // @ts-expect-error ST-2949_3
267 var el_store = rec.querySelector('.js-catalog');
268 if (rec && !t_catalog_productTemplate__initPopupShell(rec, options)) {
269 var prodPopup = t_catalog_get_productPopup_html(recid, options);
270 if (el_store) {
271 el_store.insertAdjacentHTML('beforeend', prodPopup);
272 }
273 }
274
275 options.isPublishedPage = t_catalog__isPublishedMode();
276 options.needGetPartInfo = true;
277 // draw product popup if we have it in URL
278 if (options.isPublishedPage) {
279 t_catalog_checkUrl(options, recid);
280 }
281 var recParent = document.getElementById('record' + recid);
282 if (recParent && !options.isPublishedPage) {
283 var off = recParent.getAttribute('off');
284 if (off == 'y') {
285 return;
286 }
287 }
288
289 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
290 // @ts-expect-error ST-2949_3
291 var gridPreloader = rec.querySelector('.js-catalog-grid-cont-preloader');
292 if (options.storepart === '') {
293 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
294 // @ts-expect-error ST-2949_1
295 gridPreloader.style.display = 'none';
296 if (options.sidebar) {
297 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
298 // @ts-expect-error ST-2949_3
299 var tCatalogGridContainer = rec.querySelector('.t-catalog__grid-cont');
300 if (tCatalogGridContainer) {
Предыдущие 100 строкСледующие 100 строк