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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
5301		});5302	}5303 5304	// draw characteristics5305	// add 'dimensions' & 'weight' always5306	charcsTextOnly += '<p class="js-catalog-prod-dimensions t-typography__characteristics"></p>';5307	charcsTextOnly += '<p class="js-catalog-prod-weight t-typography__characteristics"></p>';5308	charcsTextWithDiv += charcsTextOnly;5309	charcsTextWithDiv += '</div>';5310	if (el_prodTxt) {5311		el_prodTxt.insertAdjacentHTML('beforeend', prodTxt);5312
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
el_prodTxt.insertAdjacentHTML('beforeend', charcsTextWithDiv);
5313 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
5314 // @ts-expect-error ST-2949_1
5315 el_prodTxt.style.display = '';
5316 }
5317
5318 // Redraw dimensions and weight if corresponding tab exists in snippet
5319 if (isSnippet && el_tabCharcs.length) {
5320 Array.prototype.forEach.call(el_tabCharcs, function (item, i) {
5321 var el_charcsContent = item.querySelector('.t-catalog__tabs__content');
5322 if (el_charcsContent) {
5323 while (el_charcsContent.firstChild) {
5324 el_charcsContent.removeChild(el_charcsContent.firstChild);
5325 }
5326 el_charcsContent.insertAdjacentHTML('beforeend', charcsTextOnly);
5327
5328 if (i !== 0) {
5329 el_charcsContent.querySelector('.js-catalog-prod-dimensions').parentNode.style.display = '';
5330 }
5331 }
5332 });
5333 }
5334
5335 // add dimension if !== 0
5336 if (isDimentions) {
5337 var dimension = pack_x + 'x' + pack_y + 'x' + pack_z;
5338 var fullDimension =
5339 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5340 // @ts-expect-error ST-2949_3
5341 window.tCatalogDict['product-' + pack_label] + ': ' + dimension + '&nbsp;' + window.tCatalogDict['mm'];
5342 var storeProdDimensions = el_popup.querySelector('.js-catalog-prod-dimensions');
5343 if (storeProdDimensions) storeProdDimensions.innerHTML = fullDimension;
5344
5345 if (isSnippet) {
5346 Array.prototype.forEach.call(el_tabCharcs, function (tabCharc) {
5347 var storeProdDimensions = tabCharc.querySelector('.js-catalog-prod-dimensions');
5348 if (storeProdDimensions) {
5349 storeProdDimensions.innerHTML = fullDimension;
5350 }
5351 });
5352
5353 el_popup.setAttribute('data-product-pack-label', pack_label);
5354 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5355 // @ts-expect-error ST-2949_5
5356 el_popup.setAttribute('data-product-pack-x', pack_x);
5357 // @ts-expect-error ST-2949_5
5358 el_popup.setAttribute('data-product-pack-y', pack_y);
5359 // @ts-expect-error ST-2949_5
5360 el_popup.setAttribute('data-product-pack-z', pack_z);
5361 }
5362 }
5363
5364 // add weight if !== 0
5365 if (isWeight) {
5366 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
5367 // @ts-expect-error ST-2949_3
5368 var fullWeight = window.tCatalogDict['product-weight'] + ': ' + pack_m + '&nbsp;' + window.tCatalogDict['g'];
5369 // @ts-expect-error ST-2949_3
5370 el_popup.querySelector('.js-catalog-prod-weight').innerHTML = fullWeight;
5371
5372 if (isSnippet) {
5373 if (el_tabCharcs.length) {
5374 Array.prototype.forEach.call(el_tabCharcs, function (tabCharc) {
5375 var storeProdWeight = tabCharc.querySelector('.js-catalog-prod-weight');
5376 if (storeProdWeight) {
5377 storeProdWeight.innerHTML = fullWeight;
5378 }
5379 });
5380 }
5381 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5382 // @ts-expect-error ST-2949_5
5383 el_popup.setAttribute('data-product-pack-m', pack_m);
5384 }
5385 }
5386
5387 // add data attributes for characteristics
5388 var storeProduct = el_popup.querySelector('.js-catalog-product');
5389
5390 if (isSnippet && el_popup.classList.contains('js-catalog-product')) {
5391 storeProduct = el_popup;
5392 }
5393
5394 if (storeProduct) {
5395 storeProduct.setAttribute('data-product-pack-label', pack_label);
5396 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
5397 // @ts-expect-error ST-2949_5
5398 storeProduct.setAttribute('data-product-pack-m', pack_m);
5399 // @ts-expect-error ST-2949_5
5400 storeProduct.setAttribute('data-product-pack-x', pack_x);
Предыдущие 100 строкСледующие 100 строк