Каталог файловtilda-cart-1.1.js
1001 }1002 1003 // закрывает другие попапы1004 if (1005 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)1006 // @ts-expect-error ST-2949_31007 body.classList.contains('t-body_popupshowed') ||1008 document.querySelectorAll('.t-popup.t-popup_show').length > 01009 ) {1010 t_triggerEvent(document.body, 'popupHidden');1011 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)1012
История файла и сравнение версий
// @ts-expect-error ST-2949_3
1013 body.classList.remove('t-body_popupshowed'); 1014 Array.prototype.forEach.call(document.querySelectorAll('.t-popup'), function (popup) { 1015 popup.classList.remove('t-popup_show'); 1017 setTimeout(function () { 1018 Array.prototype.forEach.call( 1019 document.querySelectorAll('.t-popup:not(.t-popup_show)'), 1021 popup.style.display = 'none'; 1025 tcart__clearProdUrl(); 1028 var cartBtnLink = cartBtn.getAttribute('href'); 1030 /** Цена числом после tcart__cleanPrice. Пока её нет, цена товара — строка price */ 1031 /** @type {number | undefined} */ 1046 var pack_label = ''; 1054 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1055 // @ts-expect-error ST-2949_2 1058 if (cartBtnLink.substring(0, 7) === '#order:') { 1059 var productData = cartBtnLink.substring(7); 1061 // если есть специальный параметр для картинки 1062 if (productData.indexOf(':::') > 0) { 1063 var imgLinkPos = productData.indexOf(':::'); 1064 // проверяет, что ::: не в названии товара 1065 if (productData.indexOf('=') > 0 && productData.indexOf('=') < productData.indexOf(':::')) { 1066 imgLink = productData.substring(imgLinkPos + 3); 1067 productData = productData.substring(0, imgLinkPos); 1069 if (imgLink.indexOf(':::') !== -1) { 1070 var arrParams = imgLink.split(':::'); 1072 for (var i = 0; i < arrParams.length; i++) { 1073 var param = arrParams[i]; 1075 if (param.indexOf('image=') !== -1) { 1084 if (productData.indexOf('=') > 0) { 1085 var productDataParams = productData.split('='); 1086 if (productDataParams[0]) name = productDataParams[0].trim(); 1087 if (productDataParams[1]) price = productDataParams[1]; 1088 cleanedPrice = tcart__cleanPrice(price); 1093 // Декодируем название, так как HTML кодирует кириллицу в href 1094 // Не трогаем весь payload до split('='), чтобы %3D в имени не ломал цену 1095 if (name) name = t_cart__safeDecodeURIComponent(name).trim(); 1097 // обрабатывает параметры 1098 if (typeof imgLink !== 'undefined' && imgLink !== '') { 1099 if (imgLink.indexOf('=') > 0) { 1100 var imgLinkArr = imgLink.split('=');