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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
5601							productObj = dataObj.product;5602						} catch (error) {5603							console.error(error);5604						}5605						if (!productObj) {5606							console.error(5607								"Can't get product with uid = " + curProdUid + ' in storepart = ' + options.storepart5608							);5609							return;5610						}5611						t_catalog_openProductPopup(recid, options, productObj);5612
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
} else {
5613 console.error(
5614 "Can't get product with uid = " + curProdUid + ' in storepart = ' + options.storepart
5615 );
5616 }
5617 };
5618
5619 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
5620 // @ts-expect-error ST-2949_2
5621 t_catalog_loadOneProduct(recid, options, curProdUid, onDone, function (error) {
5622 t_catalog_changeEndpoint(error, function () {
5623 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5624 // @ts-expect-error ST-2949_5
5625 t_catalog_loadOneProduct(recid, options, curProdUid, onDone);
5626 });
5627 });
5628 } else {
5629 // if user coming from catalog redirect back to main page
5630 }
5631 }
5632 }
5633}
5634
5635// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
5636// @ts-expect-error ST-2949_2
5637function t_catalog_showPopup(recid, fromHistory, fromPopup) {
5638 var el = document.getElementById('rec' + recid);
5639 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5640 // @ts-expect-error ST-2949_3
5641 var popup = el.querySelector('.t-popup');
5642 t_catalog_resetNavStyles(recid);
5643
5644 t_catalog_triggerEvent(document.body, 'popupShowed');
5645 document.body.classList.add('t-body_popupshowed');
5646
5647 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
5648 // @ts-expect-error ST-2949_1
5649 popup.style.display = 'block';
5650 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5651 // @ts-expect-error ST-2949_3
5652 var isPopupOverflowed = popup.scrollHeight > document.documentElement.clientHeight;
5653 if (!isPopupOverflowed) {
5654 // remove scrollbar before show popup
5655 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
5656 // @ts-expect-error ST-2949_1
5657 popup.style.overflow = 'hidden';
5658 }
5659
5660 setTimeout(function () {
5661 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5662 // @ts-expect-error ST-2949_3
5663 popup.querySelector('.t-popup__container').classList.add('t-popup__container-animated');
5664 // @ts-expect-error ST-2949_3
5665 popup.classList.add('t-popup_show');
5666 t_catalog_triggerEvent(document.body, 'twishlist_addbtn');
5667 t_catalog_popup_updateLazyLoad();
5668 if (!isPopupOverflowed) {
5669 // add scrollbar after .3s of transition
5670 setTimeout(function () {
5671 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
5672 // @ts-expect-error ST-2949_1
5673 popup.style.overflow = 'auto';
5674 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5675 // @ts-expect-error ST-2949_5
5676 t_catalog_triggerEvent(popup, t_catalog_POPUP_SHOWED_EVENT_NAME);
5677 }, 300);
5678 return;
5679 }
5680 // подскроливаем к верху, необходимо для корректного
5681 // отображения попапа (если в предыдущий раз мы доскролили до низа)
5682 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5683 // @ts-expect-error ST-2949_3
5684 popup.scrollTop = 0;
5685 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5686 // @ts-expect-error ST-2949_5
5687 t_catalog_triggerEvent(popup, t_catalog_POPUP_SHOWED_EVENT_NAME);
5688 }, 50);
5689
5690 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5691 // @ts-expect-error ST-2949_3
5692 popup.addEventListener(t_catalog_POPUP_SHOWED_EVENT_NAME, t_catalog_popup_updateLazyLoad);
5693
5694 if (!fromPopup) {
5695 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5696 // @ts-expect-error ST-2949_5
5697 t_catalog_addPopupEvents(el, recid);
5698 }
5699}
5700
Предыдущие 100 строкСледующие 100 строк