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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
6801	var el_popup = popupElement;6802 6803	// TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)6804	// @ts-expect-error ST-2949_46805	if (window.jQuery && el_popup instanceof jQuery) {6806		if (el_popup.length === 0) {6807			return;6808		}6809		el_popup = el_popup[0];6810	}6811 6812	if (!el_popup) return;
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
6813
6814 var prodSliderElement = el_popup.querySelector('.js-catalog-prod-slider');
6815 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
6816 // @ts-expect-error ST-2949_2
6817 var galleryArr;
6818 if (!product.gallery) {
6819 if (prodSliderElement) prodSliderElement.innerHTML = '';
6820 return;
6821 }
6822
6823 if (typeof product.gallery === 'string') {
6824 galleryArr = JSON.parse(product.gallery);
6825 } else {
6826 galleryArr = product.gallery;
6827 }
6828
6829 if (galleryArr.length === 0) {
6830 if (prodSliderElement) prodSliderElement.innerHTML = '';
6831 return;
6832 }
6833
6834 var initGallery = function () {
6835 var params = {
6836 recid: recid,
6837 el_popup: el_popup,
6838 product: product,
6839 options: options,
6840 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
6841 // @ts-expect-error ST-2949_2
6842 galleryArr: galleryArr,
6843 };
6844 var isMobileDevice =
6845 window.isMobile || ('ontouchend' in document && navigator.userAgent.indexOf('AppleWebKit') !== -1);
6846 var windowWidth = isMobileDevice ? document.documentElement.clientWidth : window.innerWidth;
6847 if (
6848 (options.galleryStyle && windowWidth > GALLERY_BREAKPOINT) ||
6849 (options.popup_opts.mobileGalleryStyle && windowWidth <= GALLERY_BREAKPOINT)
6850 ) {
6851 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
6852 // @ts-expect-error ST-2949_4
6853 t_catalog__loadCatalogSlds().then(() => t_catalog__initCustomGallery(params));
6854 } else {
6855 // если была ранее другая галерея, то убираем фиксацию во время скролла текста/правой колонки
6856 if (options.galleryStyle) {
6857 var prodInfo = el_popup.querySelector('.t-catalog__prod-popup__info');
6858 if (prodInfo) {
6859 prodInfo.classList.remove('t-catalog__prod-popup__col_fixed');
6860 }
6861 }
6862
6863 t_catalog__initDefaultGallery(params);
6864 }
6865 };
6866
6867 initGallery();
6868
6869 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
6870 // @ts-expect-error ST-2949_1
6871 if (window.t_catalog_drawProdPopup_resizeGalleryEvent) {
6872 // @ts-expect-error ST-2949_1
6873 window.removeEventListener('resize', window.t_catalog_drawProdPopup_resizeGalleryEvent);
6874 }
6875
6876 // @ts-expect-error ST-2949_1
6877 window.t_catalog_drawProdPopup_resizeGalleryEvent = function () {
6878 var isMobileDevice =
6879 window.isMobile || ('ontouchend' in document && navigator.userAgent.indexOf('AppleWebKit') !== -1);
6880 var windowWidth = isMobileDevice ? document.documentElement.clientWidth : window.innerWidth;
6881 var desktopGalleryClass = '.js-catalog-desktop-custom-gallery';
6882 var mobileGalleryClass = '.js-catalog-mobile-custom-gallery';
6883 var galleryStyle = options.galleryStyle || '';
6884 var validGalleryStyles = ['col1_fixed', 'col2_fixed'];
6885 var desktopGalleryStyle = galleryStyle && validGalleryStyles.indexOf(galleryStyle) !== -1;
6886 var isDesktopGallery = desktopGalleryStyle && windowWidth > GALLERY_BREAKPOINT;
6887 var mobileGalleryStyle = options.popup_opts.mobileGalleryStyle || '';
6888 var isMobileGallery = mobileGalleryStyle && windowWidth <= GALLERY_BREAKPOINT;
6889
6890 if (
6891 (options.galleryStyle && windowWidth >= GALLERY_BREAKPOINT) ||
6892 (options.popup_opts.mobileGalleryStyle && windowWidth < GALLERY_BREAKPOINT)
6893 ) {
6894 // не инициализируем галерею повторно, если кастомная уже есть
6895 if (
6896 (prodSliderElement.querySelector(desktopGalleryClass) && isDesktopGallery) ||
6897 (prodSliderElement.querySelector(mobileGalleryClass) && isMobileGallery)
6898 )
6899 return;
6900 } else {
Предыдущие 100 строкСледующие 100 строк