Каталог файловtilda-catalog-1.2.js
1501 // Сбрасываем флаг после использования1502 // @ts-expect-error ST-2949_11503 options.needGetPartInfo = false;1504 }1505 1506 // @ts-expect-error ST-2949_11507 if (options?.breadcrumbs?.hasBreadcrumbs) {1508 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1509 // @ts-expect-error ST-2949_21510 dataObj['getbreadcrumbs[]'] = 'parts';1511 }1512
История файла и сравнение версий
// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
1513 // @ts-expect-error ST-2949_1 1514 if (options?.breadcrumbs?.hasBreadcrumbs && !options?.breadcrumbs?.hideBreadcrumbsProduct) { 1515 // Увеличиваем ключ, если уже есть ключ parts 1516 // @ts-expect-error ST-2949_1 1517 const breadcrumbsKey = options?.breadcrumbs?.hasBreadcrumbs ? '1' : ''; 1518 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1519 // @ts-expect-error ST-2949_2 1520 dataObj[`getbreadcrumbs[${breadcrumbsKey}]`] = 'products'; 1525 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1526 // @ts-expect-error ST-2949_1 1527 window.t_catalog_endpoint + 1529 (showRelevants ? '/getrelevantproducts/' : '/getproductslist/'); 1531 // inside tilda we get data from another url 1533 if (!options.isPublishedPage) { 1534 var domainParts = window.location.hostname.split('.'); 1535 var link = 'tilda.' + domainParts[domainParts.length - 1]; 1536 // @ts-expect-error ST-2949_1 1537 dataObj.projectid = document.getElementById('allrecords').getAttribute('data-tilda-project-id'); 1539 'https://' + link + '/projects/store' + (showRelevants ? '/getrelevantproducts/' : '/getproductslist/'); 1542 var ts = Date.now(); 1544 if (!window.tStoreXHR) { 1545 window.tStoreXHR = {}; 1547 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1548 // @ts-expect-error ST-2949_2 1549 if (window.tStoreXHR[recid]) { 1550 // @ts-expect-error ST-2949_2 1551 window.tStoreXHR[recid].abort(); 1552 // @ts-expect-error ST-2949_2 1553 delete window.tStoreXHR[recid]; 1556 // В редакторе повторный рендер записи после изменения настроек берёт ответ из кэша (микрозадачей, без сети): 1557 // карточки отрисовываются до показа превью, и блок не моргает. В превью и на опубликованной странице — null. 1558 // Новый вызов для этой записи отменяет ответ из кэша так же, как xhr: через window.tStoreXHR[recid].abort(). 1559 // Ключ берём до отправки: dataObj.filters — ссылка на options.filters, и фильтры могут поменяться, пока запрос в пути. 1560 // getrelevantproducts не кэшируется: ключ null. 1561 var editCacheKey = showRelevants ? null : t_catalog_editCache__getKey('getproductslist', apiUrl, dataObj); 1562 var cachedRequest = t_catalog_editCache__respond(editCacheKey, handleProductsResponse); 1563 if (cachedRequest) { 1564 // @ts-expect-error ST-2949_2 1565 window.tStoreXHR[recid] = cachedRequest; 1569 var xhr = new XMLHttpRequest(); 1570 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1571 // @ts-expect-error ST-2949_2 1572 window.tStoreXHR[recid] = xhr; 1574 xhr.onload = function () { 1575 if (xhr.readyState === xhr.DONE && xhr.status === 200) { 1576 if (t_catalog__handleRootzoneRedirect(xhr.responseText, apiUrl)) { 1577 // повтор того же запроса: флаг должен дожить до него 1578 options.skipFiltersInit = skipFiltersInit; 1579 t_catalog_loadProducts(method, recid, options, slice, relevantsOpts); 1582 t_catalog_editCache__remember(editCacheKey, xhr.responseText); 1583 handleProductsResponse(xhr.responseText); 1588 * Обрабатывает ответ getproductslist / getrelevantproducts: из сети или из кэша редактора 1589 * @param {string} data - текст ответа 1591 function handleProductsResponse(data) { 1592 // Отмечаем, что данные для этого блока загружены 1593 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1594 // @ts-expect-error ST-2949_1 1595 window.tCatalogFirstLoadStates[recid] = true; 1597 t_catalog__hidePreloader(recid); 1599 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1600 // @ts-expect-error ST-2949_1