7101Array.prototype.forEach.call(playButtons, function (play) {7102if (play) {7103play.addEventListener('click', function () {7104// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)7105// @ts-expect-error ST-2949_27106const parentNode = this.parentNode;7107let frameWrapper = parentNode.querySelector('.t-slds__frame-wrapper');7108if (!frameWrapper) {7109frameWrapper = document.createElement('div');7110frameWrapper.classList.add('t-slds__frame-wrapper');7111// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
// @ts-expect-error ST-2949_2 this.insertAdjacentElement('afterend', frameWrapper); } frameWrapper.style.zIndex = 3; // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) // @ts-expect-error ST-2949_2 const videoType = this.getAttribute('data-slider-video-type'); // @ts-expect-error ST-2949_2 const videoId = this.getAttribute('data-slider-video-url'); // @ts-expect-error ST-2949_2 const videoHash = this.getAttribute('data-slider-video-hash'); // @ts-expect-error ST-2949_2 const videoTime = this.getAttribute('data-slider-video-time'); // @ts-expect-error ST-2949_2 const videoParams = this.getAttribute('data-slider-video-params'); // @ts-expect-error ST-2949_2 const vkOID = this.getAttribute('data-slider-video-oid'); const videoEl = t_catalog__getVideoElement(videoType, { videoId, videoHash, videoTime, vkOID, videoParams, }); if (!videoEl) return; frameWrapper.innreHtml = ''; frameWrapper.appendChild(videoEl); // Удаляем при закрытии попапа и листании слайдера const removeIframe = () => { videoEl.remove(); frameWrapper.style.zIndex = ''; }; document.addEventListener('popupHidden', removeIframe, { once: true }); // Отключаем видео при переключении слайдов const sliderWrapper = recEl.querySelector('.t-slds__items-wrapper'); if (sliderWrapper) { sliderWrapper.addEventListener('slideChangeStart', removeIframe, { once: true }); } // Отключаем видео при переключении доп опций const el_product = parentNode.closest('.js-product'); if (el_product) { el_product.addEventListener('tStoreVariantChange', removeIframe, { once: true }); } }); } });}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_prodPopup_updateGalleryThumbs(recid, el_popup, product, options) { var rec = document.getElementById('rec' + recid); var galleryArr; var hasThumbs = options.slider_opts.controls === 'thumbs' || options.slider_opts.controls === 'arrowsthumbs'; if (hasThumbs || options.sliderthumbsside !== 'l') { return; } if (!product.gallery) { return; } if (typeof product.gallery === 'string') { galleryArr = JSON.parse(product.gallery); } else { galleryArr = product.gallery; } var prodSlider = el_popup.querySelector('.js-catalog-prod-slider'); if (galleryArr.length === 0) { if (prodSlider) prodSlider.innerHTML = ''; return; } var columnSizeForMainImage = parseInt(options.popup_opts.columns, 10); var galleryImageAspectRatio = +options.slider_slidesOpts.ratio; var thumbsSize = 60, marginBetweenThumbs = 10; // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 var thumbsCount = rec.querySelectorAll('.t-slds__thumbsbullet').length; var maxThumbsCount = t_catalog_prodPopup_gallery_calcMaxThumbsCount(