1901// @ts-expect-error ST-2949_11902var offsetWidth = gridContainer.offsetWidth;1903// @ts-expect-error ST-2949_11904if (offsetWidth + scrollLeft + 20 > scrollWidth && loadMoreBtn.style.display !== 'none') {1905// @ts-expect-error ST-2949_11906loadMoreBtn.click();1907// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1908// @ts-expect-error ST-2949_21909gridContainer.removeEventListener('scroll', loadMoreScrollEvent);1910}1911}
}); }); var isMobileOneRow = gridContainer && gridContainer.classList.contains('t-catalog__grid-cont_mobile-one-row'); // load more // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (obj.nextslice) { // add load more button if (!loadMoreBtn) { // 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 loadMoreBtn = t_catalog_get_loadMoreBtn_html(rec, options); // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 var pagination = rec.querySelector( '.t-catalog__cont-w-filter .t-catalog__cont-wrapper + .t-catalog__pagination' ); if (!pagination) { // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 var gridCont = rec.querySelector('.t-catalog__cont-w-filter'); if (gridCont) { // 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 gridCont.insertAdjacentHTML('beforeend', loadMoreBtn); } } // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 loadMoreBtn = rec.querySelector('.js-catalog-load-more-btn'); } if (loadMoreBtn) { // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 loadMoreBtn.style.display = ''; var loadMoreBtnClickEvent = function () { if (t_catalog__isEditMode()) return; // @ts-expect-error ST-2949_1 if (!window.tCatalogProductsRequested) { // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 loadMoreBtn.classList.add('t-btn_sending'); // Фильтры при подгрузке товаров не меняются, не перерисовываем их, чтобы сохранить раскрытые списки options.skipFiltersInit = true; // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 t_catalog_loadProducts('', recid, options, obj.nextslice); } }; // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 loadMoreBtn.parentNode.replaceChild(loadMoreBtn.cloneNode(true), loadMoreBtn); // @ts-expect-error ST-2949_3 loadMoreBtn = rec.querySelector('.js-catalog-load-more-btn'); // @ts-expect-error ST-2949_3 loadMoreBtn.addEventListener('click', loadMoreBtnClickEvent); } if (isMobileOneRow) { // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 gridContainer.addEventListener('scroll', loadMoreScrollEvent); } } else if (!showRelevants) { if (loadMoreBtn) { // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 loadMoreBtn.style.display = 'none'; } if (gridContainer) { // 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 gridContainer.removeEventListener('scroll', loadMoreScrollEvent); } } // add Pagination // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (options.showPagination && options.showPagination === 'on' && !showRelevants) { t_catalog_onFuncLoad('t_catalog_pagination_draw', function () { // @ts-expect-error ST-2949_1 t_catalog_pagination_draw(recid, options, slice, obj.total); });