Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-catalog-1.2.js Следить за файлом 801 * When the user clicks on the back button, the product data is retrieved from the browser's history.802 * This data is then used to open the product popup803 **/804 function t_catalog_initRouting() {805 window.onpopstate = function () {806 if (window.history.state && window.history.state.productData) {807 var productPopupData = window.history.state.productData;808 var recid = productPopupData.recid,809 options = productPopupData.opts,810 productObj = productPopupData.productObj,811 isRelevantsShow = productPopupData.isRelevantsShow;История файла и сравнение версий t_catalog_openProductPopup(recid, options, productObj, isRelevantsShow);
818 * Получает главную кнопку сниппета819 * @param {string} recid820 * @returns {HTMLButtonElement | null}822 function t_catalog_getSnippetMainButton(recid) {823 const rec = document.getElementById('rec' + recid);829 return rec.querySelector('.t-catalog__prod-popup__btn-wrapper .t-catalog__prod-popup__btn');833 * Создает массив базовых CSS-правил для кнопки834 * @param {Record<string, string>} cssPropertiesMap835 * @param {Record<string, string>} styles836 * @returns {string[]}838 function t_catalog_buildBaseButtonCssRules(cssPropertiesMap, styles) {839 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)840 // @ts-expect-error ST-2949_2841 const baseRules = [];842 // Основные одиночные поля по маппингу843 Object.keys(cssPropertiesMap).forEach(function (key) {844 const cssProp = cssPropertiesMap[key];845 const value = styles[key];847 if (key === 'bgcolor') {848 if (t_catalog_isGradient(value)) {849 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)850 // @ts-expect-error ST-2949_2851 t_catalog_addRule(baseRules, 'background-image', value);852 // @ts-expect-error ST-2949_2853 t_catalog_addRule(baseRules, 'background-color', 'transparent');855 // @ts-expect-error ST-2949_2856 t_catalog_addRule(baseRules, 'background-color', value);857 // @ts-expect-error ST-2949_2858 t_catalog_addRule(baseRules, 'background-image', 'none');861 // @ts-expect-error ST-2949_2862 t_catalog_addRule(baseRules, cssProp, value);867 const size = styles.bordersize || '0';868 const color = styles.bordercolor || 'transparent';869 if (styles.bordersize || styles.bordercolor) {870 if (/^0($|[^0-9])/i.test(size) || size === '0px') {871 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)872 // @ts-expect-error ST-2949_2873 t_catalog_addRule(baseRules, 'border', 'none');875 // @ts-expect-error ST-2949_2876 t_catalog_addRule(baseRules, 'border', size + ' solid ' + color);881 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)882 // @ts-expect-error ST-2949_2883 t_catalog_addRule(baseRules, 'transition-duration', styles.speedhover || '0.2s');885 // @ts-expect-error ST-2949_2887 'transition-property',888 'background-color, color, border-color, box-shadow, opacity, transform'890 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)891 // @ts-expect-error ST-2949_2892 t_catalog_addRule(baseRules, 'transition-timing-function', 'ease-in-out');894 // Добавим переменные для поддержки hover895 if (styles.bgcolorhover) {896 if (t_catalog_isGradient(styles.bgcolorhover)) {897 // Используем CSS переменные как и раньше898 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)899 // @ts-expect-error ST-2949_2900 t_catalog_addRule(baseRules, '--button-after-background-image-hover', styles.bgcolorhover);