3001// @ts-expect-error ST-2949_13002cartWindow.style.transition = 'opacity .3s';3003// TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)3004// @ts-expect-error ST-2949_33005cartWindow.classList.add('t706__cartwin_showed');30063007// фикс для анимации3008setTimeout(function () {3009// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)3010// @ts-expect-error ST-2949_13011cartWindow.style.opacity = 1;3012
tcart__updateLazyload(); }, 0); tcart__reDrawProducts(); tcart__reDrawTotal(); void tcart__initAuthAndDelivery(); void tcart__syncBuyerLoyaltyDiscount(); document.addEventListener('keyup', tcart__keyUpFunc); tcart__onFuncLoad('t_forms__calculateInputsWidth', function () { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_forms__calculateInputsWidth(); });}/** * Перерисовывает товары в окне корзины **/function tcart__reDrawProducts() { var cartWindowProducts = tcart__getProductsContainer(); var cartContent = document.querySelector('.t706__cartwin-content'); var cartWindowContentTop = document.querySelector('.t706__cartwin-top'); var cartWindowContentBottom = document.querySelector('.t706__cartwin-bottom'); // 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 var actualProductsObj = []; if (window.tcart_fullscreen) { cartContent = document.querySelector('.t706__sidebar-content'); cartWindowContentTop = document.querySelector('.t706__sidebar-top'); } // удаляет пустые или удаленные товары // 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 if (window.tcart['products'] !== undefined) { actualProductsObj = []; // @ts-expect-error ST-2949_2 var oldCountProducts = window.tcart['products'].length; // @ts-expect-error ST-2949_2 Array.prototype.forEach.call(window.tcart['products'], function (product) { if (!tcart__isEmptyObject(product) && product.deleted !== 'yes' && product.quantity > 0) { actualProductsObj.push(product); } }); // 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 window.tcart['products'] = actualProductsObj; // @ts-expect-error ST-2949_2 var actualCountProducts = window.tcart['products'].length; if (actualCountProducts !== oldCountProducts) { tcart__saveLocalObj(); } } var hasImg = ''; if (actualProductsObj.length > 0) { // 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 Array.prototype.forEach.call(actualProductsObj, function (product) { if (product['img'] != '') { hasImg = 'yes'; } }); } if (actualProductsObj.length > 0) { var str = ''; // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) // @ts-expect-error ST-2949_5 var cartContentStyles = getComputedStyle(cartContent); var cartContentBgColor = cartContentStyles.backgroundColor || 'rgb(255,255,255)'; var colorSvgIcon = t_cart__getContrastTextColor(cartContentBgColor); var invertSvgIcon = colorSvgIcon === '#fff' ? 'filter:invert(100%);' : ''; // 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 Array.prototype.forEach.call(actualProductsObj, function (product, index) { str += '<div class="t706__product" data-cart-product-i="' + index + '">'; if (hasImg == 'yes') { str += '<div class="t706__product-thumb"><div class="t706__product-imgdiv"' + (product['img'] !== '' ? 'style="background-image:url(\'' + product['img'] + '\');"' : '') + '></div></div>'; } str += '<div class="t706__product-title t-descr t-descr_sm">'; if (product.url) {