5101}51025103// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)5104// @ts-expect-error ST-2949_25105function t_catalog_drawProdPopup(recid, el_popup, product, options, fromPopup) {5106el_popup.scrollTop = 0;51075108var el_product = el_popup.querySelector('.js-catalog-product.js-product');5109el_product.setAttribute('data-card-size', 'large');5110t_catalog_drawProdPopup_drawGallery(recid, el_popup, product, options);5111if (!window.tStoreDefPackObj) {
window.tStoreDefPackObj = {}; } var storeProduct = el_popup.querySelector('.js-catalog-product'); storeProduct.setAttribute('data-product-lid', product.lid || ''); storeProduct.setAttribute('data-product-uid', product.uid || ''); storeProduct.setAttribute('data-product-gen-uid', product.uid || product.lid); initProductPopupBreadcrumbs(recid, el_popup, product, options); var storeProdName = el_popup.querySelector('.js-catalog-prod-name'); if (product.title) { storeProdName.innerHTML = product.title; storeProdName.style.display = ''; } else { storeProdName.innerHTML = ''; storeProdName.style.display = 'none'; } var partuids = []; try { partuids = JSON.parse(product.partuids); } catch (error) { console.error(error); } storeProduct.setAttribute('data-product-part-uid', partuids.join(',')); // links for size chart if (options.linksSizeChart && partuids.length > 0) { var str = ''; var linksAdded = []; for (var i = 0; i < partuids.length; i++) { var uid = partuids[i]; if ( options.linksSizeChart[uid] && options.linksSizeChart[uid].infotext && options.linksSizeChart[uid].infourl ) { if (linksAdded.indexOf(options.linksSizeChart[uid].infourl) === -1) { str += '<div class="t-catalog__prod-popup__link t-descr t-descr_xxs">'; str += '<a href="' + options.linksSizeChart[uid].infourl.replace(/"/g, '"') + '" target="_blank">'; str += options.linksSizeChart[uid].infotext; str += '</a>'; str += '</div>'; linksAdded.push(options.linksSizeChart[uid].infourl); } } } el_popup.querySelector('.t-catalog__prod-popup__links-wrapper').innerHTML = str; } else { el_popup.querySelector('.t-catalog__prod-popup__links-wrapper').innerHTML = ''; } t_catalog_initTextAndCharacteristics(el_popup, product); var onPopupReady = function () { // t_catalog_initTextAndCharacteristics(el_popup, product); t_catalog_addProductOptions(recid, product, el_product, options); t_catalog_onFuncLoad('t_prod__initProduct', function () { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_prod__initProduct(el_product, options); }); t_catalog_notifyButton_applyEffects(el_popup); window.t_catalog_prodPopup_updateGalleryThumbsEvent = function () { t_catalog_prodPopup_updateGalleryThumbs(recid, el_popup, product, options); }; if (fromPopup) { window.removeEventListener('resize', window.t_catalog_prodPopup_updateGalleryThumbsEvent); } window.addEventListener('resize', window.t_catalog_prodPopup_updateGalleryThumbsEvent); }; onPopupReady(); // Draw tabs if (options.tabs) { t_catalog_onFuncLoad('t_catalog_tabs_init', function () { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_catalog_tabs_init(recid, options, product, el_product, el_popup, onPopupReady); }); } return false;