Каталог файловtilda-catalog-1.2.js
5901 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)5902 // @ts-expect-error ST-2949_35903 document.getElementById('rec' + recid).querySelector('.js-catalog-parts-switcher') &&5904 !options.hideStoreParts5905 ) {5906 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)5907 // @ts-expect-error ST-2949_45908 t_catalog_setActiveStorePart(recid);5909 }5910 if (options.tabs) {5911 t_catalog_onFuncLoad('t_catalog_tabs_videoClearFrame', function () {
История файла и сравнение версий
// TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
5913 // @ts-expect-error ST-2949_4 5914 t_catalog_tabs_videoClearFrame(recid); 5919 const currentLocationPattern = t_catalog__findBlockProductPatternInUrl(window.location.href); 5920 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 5921 // @ts-expect-error ST-2949_1 5922 if (window.urlBeforePopupOpen && currentLocationPattern) { 5923 // @ts-expect-error ST-2949_1 5924 var restoredTitle = window.titleBeforePopupOpen || document.title; 5925 // @ts-expect-error ST-2949_1 5926 t_catalog__applyHistoryState(window.history.state, restoredTitle, window.urlBeforePopupOpen, { 5928 syncCanonical: isiOS && isSafari, 5929 // @ts-expect-error ST-2949_1 5930 updateDocumentTitle: !!window.titleBeforePopupOpen, 5934 var popup = document.querySelector('.t-popup'); 5935 setTimeout(function () { 5936 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) 5937 // @ts-expect-error ST-2949_3 5938 popup.scrollTop = 0; 5939 Array.prototype.forEach.call(document.querySelectorAll('.t-popup:not(.t-popup_show)'), function (popup) { 5940 popup.style.display = 'none'; 5944 document.removeEventListener('keydown', t_catalog_closePopupKeyDown); 5945 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 5946 // @ts-expect-error ST-2949_1 5947 window.removeEventListener('resize', window.t_catalog_prodPopup_updateGalleryThumbsEvent); 5948 t_catalog_triggerEvent(document.body, 'twishlist_addbtn'); 5949 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 5950 // @ts-expect-error ST-2949_5 5951 t_catalog_triggerEvent(popup, t_catalog_POPUP_CLOSED_EVENT_NAME); 5954// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 5955// @ts-expect-error ST-2949_2 5956function t_catalog_isStorepartFromHistoryActive(storepartuid, recid, opts) { 5957 var rec = document.getElementById('rec' + recid); 5959 if (opts && !opts.storePartsArr) { 5961 when we have 'catalog' with multiple storeparts, opts include storePartsArr key 5962 so if we don't have this key we know - storepart is active 5963 because in this case we have only one part 5968 if (!storepartuid) { 5972 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) 5973 // @ts-expect-error ST-2949_3 5974 var activeStorepartUid = rec 5975 .querySelector('.js-catalog-parts-switcher.t-active') 5976 ?.getAttribute('data-storepart-uid'); 5977 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 5978 // @ts-expect-error ST-2949_5 5979 return parseInt(activeStorepartUid, 10) === parseInt(storepartuid, 10); 5982function t_catalog_closePopup_routing() { 5983 window.onpopstate = function () { 5985 if (window.history.state) { 5986 if (window.history.state.productData) { 5987 var productPopupData = window.history.state.productData; 5988 var recid = productPopupData.recid, 5989 productObj = productPopupData.productObj, 5990 isRelevantsShow = productPopupData.isRelevantsShow; 5992 options = productPopupData.opts; 5994 t_catalog_openProductPopup(recid, options, productObj, isRelevantsShow, true); 5997 if (window.history.state.storepartuid) { 5998 // var storepartuid = window.history.state.storepartuid; 5999 var optsFromHistory = window.history.state.opts; 6000 var recidFromHistory = window.history.state.recid;