Товарищи, помогите, как сделать, чтобы находился не только элемент, что и в коде но и любой другой вида как красным текстом.
Сам код:
BX.ready(() => {
function setDealcolor() {
setTimeout(function () {
let $gridContainer = document.querySelector('div#CRM_DEAL_LIST_V12_C_0');
if($gridContainer) {
document.querySelectorAll('tr[data-color]').forEach(deal => {
deal.querySelectorAll('td.main-grid-cell').forEach(dealTd => {
dealTd.style.background = deal.getAttribute('data-color');
});
});
}
}, 500);
}
setDealcolor();
BX.addCustomEvent(window, 'Grid::updated', (source) => {
setDealcolor();
});
});