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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2801		setTimeout(() => {2802			// добавляем задержку, чтобы учесть кейс, когда мы проверяем ширину колонки с базовым шрифтом2803			// а потом подгружается реальный шрифт (который может быть больше/меньше чем базовый)2804			t_catalog_unifyCardsWidth(recid);2805		}, 1000);2806	}2807 2808	if (!options.previewmode) {2809		try {2810			/* TODO: fix */2811 2812			// TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
2813 // @ts-expect-error ST-2949_3
2814 window.tp__record__addEditFieldEvents(recid);
2815 } catch (e) {
2816 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2817 // @ts-expect-error ST-2949_5
2818 console.error(e.message);
2819 }
2820 }
2821}
2822
2823/**
2824 * Append products to the grid container and show them
2825 *
2826 * @param {HTMLElement} el_rec
2827 * @param {HTMLElement} gridContainer - the grid container where the products will be appended
2828 * @param {string} productsHtml - the HTML of the products to be appended to the grid
2829 **/
2830function t_catalog_process_appendAndShowProducts(el_rec, gridContainer, productsHtml) {
2831 gridContainer.insertAdjacentHTML('beforeend', productsHtml);
2832 hydrateCatalogGalleries(gridContainer);
2833 // TODO ST-2949_6: operators / arithmetic / unintentional comparison (TS2362, TS2365, TS2367)
2834 // @ts-expect-error ST-2949_6
2835 if (el_rec.getAttribute('data-already-loaded-first-products') === true) {
2836 // products in pagination and in tabs we show with transition
2837 setTimeout(function () {
2838 Array.prototype.forEach.call(el_rec.querySelectorAll('.t-catalog__card'), function (card) {
2839 card.classList.remove('t-catalog__card_hidden');
2840 });
2841 t_catalog__updateBgUpOverlayOffsets(el_rec);
2842 }, 10);
2843 } else {
2844 // first products we show without transition
2845 Array.prototype.forEach.call(el_rec.querySelectorAll('.t-catalog__card'), function (card) {
2846 card.classList.remove('t-catalog__card_hidden');
2847 });
2848 // flag, that next loaded products wouldn't be first for this rec
2849 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2850 // @ts-expect-error ST-2949_5
2851 el_rec.setAttribute('data-already-loaded-first-products', true);
2852 t_catalog__updateBgUpOverlayOffsets(el_rec);
2853 }
2854}
2855
2856/**
2857 * Checks if the load button is visible and if it is, it hides it
2858 *
2859 * @param {string} recid
2860 * @param {object} options
2861 **/
2862function t_catalog_mobileHoriz_checkBtnVisibility(recid, options) {
2863 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2864 // @ts-expect-error ST-2949_2
2865 var hideLoadBtn = function (recid, opts) {
2866 var rec = document.getElementById('rec' + recid);
2867 if (window.innerWidth < 960 && opts.hasMobileHorizScroll) {
2868 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
2869 // @ts-expect-error ST-2949_3
2870 var loadMoreBtn = rec.querySelector('.js-catalog-load-more-btn');
2871 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2872 // @ts-expect-error ST-2949_5
2873 t_catalog__removeElement(loadMoreBtn);
2874 }
2875 };
2876
2877 hideLoadBtn(recid, options);
2878 t_onFuncLoad('t_throttle', function () {
2879 window.addEventListener(
2880 'resize',
2881 t_throttle(function () {
2882 hideLoadBtn(recid, options);
2883 }, 500)
2884 );
2885 });
2886}
2887
2888/**
2889 * Make popup window that appears when you click on a product
2890 *
2891 * @param {string} recid
2892 * @param {CatalogOptions} options
2893 * @returns {string} - HTML of popup
2894 **/
2895function t_catalog_get_productPopup_html(recid, options) {
2896 var str = '';
2897 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
2898 // @ts-expect-error ST-2949_3
2899 var statAttr = options.popup_opts.popupStat ? 'data-track-popup="' + options.popup_opts.popupStat + '"' : '';
2900 // @ts-expect-error ST-2949_3
Предыдущие 100 строкСледующие 100 строк