Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-catalog-1.1.js Следить за файлом 801 */802 function t_store_applyButtonStyles(recid, options) {803 try {804 if (!options || !options.button_styles) return;805 806 const button = t_store_getSnippetMainButton(recid);807 if (button) {808 const isReplaced = button.classList.contains('t_catalog__prod-popup__btn-replaced');809 button.removeAttribute('style'); // очищаем инлайновые стили с бэкенда810 if (isReplaced) {811 // кнопка не должна показываться, если она заменена на notify кнопку812 История файла и сравнение версий button.style.display = 'none';
814 t_store_applyButtonClasses(button);817 let css = t_store_createButtonStyleCss(819 '.t-store__prod-popup__btn-wrapper .t-store__prod-popup__btn',820 options.button_styles823 if (options.showRelevants) {824 css += t_store_createButtonStyleCss(826 '.t-store__relevants__container .t-store__card__btn:not(.t-store__card__btn_second)',827 options.button_styles,831 if (options.button2_styles) {832 css += t_store_createButtonStyleCss(834 '.t-store__relevants__container .t-store__card__btn_second',835 options.button2_styles,841 t_store_createСssStyleTag('js-store-btn-styles-' + recid, css);843 if (button?.parentNode) {844 // Показываем кнопку, когда стили готовы845 button.parentNode.style.opacity = 1;849 const buttonWrapper = document.querySelector('.t-store__product-snippet .t-store__prod-popup__btn-wrapper');851 if (!buttonWrapper) {855 // скрываем блок полностью так как нет кнопки в попапе856 buttonWrapper.style.display = 'none';858 console.error('Ошибка при применениии стилей к кнопке (refactored): ' + error);863 * Добавляет и изменяет классы кнопки сниппета864 * @param {button} HTMLButtonElement866 function t_store_applyButtonClasses(button) {867 button.classList.add('t-btnflex');868 button.classList.add('t-btnflex_type_button');869 if (button.classList.contains('t-btn_sm')) {870 button.classList.replace('t-btn_sm', 't-btnflex_sm');872 const td = button.querySelector('td');873 td.classList.add('t-btnflex__text');878 * @param {string} recid879 * @param {string} itemSelector880 * @param {string} stylesJSON881 * @param {string[]} excludedStyles // массив с названиями свойств, которые не нужно применять884 function t_store_createButtonStyleCss(recid, itemSelector, stylesJSON, excludedStyles) {886 const styles = JSON.parse(stylesJSON);888 let css = t_store_createButtonAppereanceCss(recid, itemSelector, styles, excludedStyles);889 css += t_store_createButtonTextCss(recid, itemSelector, styles);891 if (styles.bgcolor && styles.bgcolorhover) {892 css = t_store_appendMainButtonBgHoverStyle(css);895 if (styles.iconsize) {897 .t-btnflex.t-btnflex_type_button .t-btnflex__icon {898 width: ${styles.iconsize};899 height:${styles.iconsize};