Каталог файловtilda-cart-1.1.js
6101 */6102function tcart__showWeight(weight, unit) {6103 const translateUnit = /** @type {(unit: string) => string} */ (tcart_dict);6104 return t_cart__formatWeight(weight, unit, translateUnit, tcart__roundPrice);6105}6106 6107/**6108 * Без window.tcart пустая цена даёт '', непустая бросает TypeError, как прежде6109 * @param {unknown} price6110 * @param {unknown} [isZeroValueAccept]6111 */6112
История файла и сравнение версий
function tcart__showPrice(price, isZeroValueAccept) {
6113 return t_cart__formatPrice(price, isZeroValueAccept, window.tcart); 6117 * fix IOS11 cursor bug + general IOS background scroll 6119function tcart__lockScroll() { 6121 window.t_cart__isiOS && 6122 window.t_cart__iOSMajorVersion === 11 && 6123 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 6124 // @ts-expect-error ST-2949_1 6126 !document.body.classList.contains('t-body_scroll-locked') 6129 typeof window.pageYOffset !== 'undefined' 6130 ? window.pageYOffset 6131 : (document.documentElement || document.body.parentNode || document.body).scrollTop; 6132 document.body.classList.add('t-body_scroll-locked'); 6133 document.body.style.top = '-' + bodyScrollTop + 'px'; 6134 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 6135 // @ts-expect-error ST-2949_5 6136 document.body.setAttribute('data-popup-scrolltop', bodyScrollTop); 6140function tcart__unlockScroll() { 6142 window.t_cart__isiOS && 6143 window.t_cart__iOSMajorVersion === 11 && 6144 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 6145 // @ts-expect-error ST-2949_1 6147 !document.body.classList.contains('t-body_scroll-locked') 6149 var bodyScrollTop = document.body.getAttribute('data-popup-scrolltop'); 6150 document.body.classList.remove('t-body_scroll-locked'); 6151 document.body.style.top = ''; 6152 document.body.removeAttribute('data-popup-scrolltop'); 6153 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 6154 // @ts-expect-error ST-2949_5 6155 window.scrollTo(0, bodyScrollTop); 6159function tcart__clearProdUrl() { 6160 var isiOS = /iPhone|iPad|iPod/i.test(navigator.userAgent); 6161 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 6163 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 6164 // @ts-expect-error ST-2949_1 6165 var urlBeforePopupOpen = window.urlBeforePopupOpen; 6166 // @ts-expect-error ST-2949_1 6167 var titleBeforePopupOpen = window.titleBeforePopupOpen; 6172 if (window.history.state && window.history.state.productData) { 6173 productData = window.history.state.productData; 6174 storepartuid = productData.opts.storepart; 6175 options = productData.opts; 6176 recid = productData.recid; 6177 window.history.pushState( 6179 storepartuid: storepartuid, 6183 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 6184 // @ts-expect-error ST-2949_5 6189 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 6190 // @ts-expect-error ST-2949_5 6191 window.history.pushState(null, null, urlBeforePopupOpen); 6194 if (isiOS && isSafari) { 6195 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) 6196 // @ts-expect-error ST-2949_3 6197 document.querySelector('head link[rel="canonical"]').setAttribute('href', urlBeforePopupOpen); 6198 document.title = titleBeforePopupOpen;