Каталог файловtilda-catalog-1.2.js
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
История файла и сравнение версий
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 = ''; 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); 5326 el_charcsContent.insertAdjacentHTML('beforeend', charcsTextOnly); 5329 el_charcsContent.querySelector('.js-catalog-prod-dimensions').parentNode.style.display = ''; 5335 // add dimension if !== 0 5337 var dimension = pack_x + 'x' + pack_y + 'x' + pack_z; 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 + ' ' + window.tCatalogDict['mm']; 5342 var storeProdDimensions = el_popup.querySelector('.js-catalog-prod-dimensions'); 5343 if (storeProdDimensions) storeProdDimensions.innerHTML = fullDimension; 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; 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); 5364 // add weight if !== 0 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 + ' ' + window.tCatalogDict['g']; 5369 // @ts-expect-error ST-2949_3 5370 el_popup.querySelector('.js-catalog-prod-weight').innerHTML = fullWeight; 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; 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); 5387 // add data attributes for characteristics 5388 var storeProduct = el_popup.querySelector('.js-catalog-product'); 5390 if (isSnippet && el_popup.classList.contains('js-catalog-product')) { 5391 storeProduct = el_popup; 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);