Каталог файловtilda-catalog-1.2.js
1101function t_catalog_createСssStyleTag(styleId, css) {1102 let styleEl = document.getElementById(styleId);1103 if (!styleEl) {1104 styleEl = document.createElement('style');1105 styleEl.id = styleId;1106 (document.head || document.documentElement).appendChild(styleEl);1107 }1108 1109 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)1110 // @ts-expect-error ST-2949_11111 if (styleEl.styleSheet) {1112
История файла и сравнение версий
// @ts-expect-error ST-2949_1
1113 styleEl.styleSheet.cssText = css; 1115 styleEl.textContent = css; 1120 * Применяет стили к кнопке сниппета 1121 * @param {string} recid 1122 * @param {Object} options 1124function t_catalog_applyButtonStyles(recid, options) { 1126 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1127 // @ts-expect-error ST-2949_1 1128 if (!options || !options.button_styles) return; 1130 const button = t_catalog_getSnippetMainButton(recid); 1133 const isReplaced = button.classList.contains('t_catalog__prod-popup__btn-replaced'); 1134 button.removeAttribute('style'); // очищаем инлайновые стили с бэкенда 1136 // кнопка не должна показываться, если она заменена на notify кнопку 1137 button.style.display = 'none'; 1139 t_catalog_applyButtonClasses(button); 1142 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 1143 // @ts-expect-error ST-2949_5 1144 let css = t_catalog_createButtonStyleCss( 1146 '.t-catalog__prod-popup__btn-wrapper .t-catalog__prod-popup__btn', 1147 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1148 // @ts-expect-error ST-2949_1 1149 options.button_styles 1152 // @ts-expect-error ST-2949_1 1153 if (options.showRelevants) { 1154 css += t_catalog_createButtonStyleCss( 1156 '.t-catalog__relevants__container .t-catalog__card__btn:not(.t-catalog__card__btn_second)', 1157 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1158 // @ts-expect-error ST-2949_1 1159 options.button_styles, 1163 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1164 // @ts-expect-error ST-2949_1 1165 if (options.button2_styles) { 1166 css += t_catalog_createButtonStyleCss( 1168 '.t-catalog__relevants__container .t-catalog__card__btn_second', 1169 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1170 // @ts-expect-error ST-2949_1 1171 options.button2_styles, 1177 t_catalog_createСssStyleTag('js-catalog-btn-styles-' + recid, css); 1179 if (button?.parentNode) { 1180 // Показываем кнопку, когда стили готовы 1181 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1182 // @ts-expect-error ST-2949_1 1183 button.parentNode.style.opacity = 1; 1187 const buttonWrapper = document.querySelector('.t-catalog__product-snippet .t-catalog__prod-popup__btn-wrapper'); 1189 if (!buttonWrapper) { 1193 // скрываем блок полностью так как нет кнопки в попапе 1194 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 1195 // @ts-expect-error ST-2949_1 1196 buttonWrapper.style.display = 'none'; 1198 console.error('Ошибка при применениии стилей к кнопке (refactored): ' + error);