Skip to content

Commit e600784

Browse files
more logic so that backgroundColor style does not get erased when setting text-color in UE
1 parent 24f14de commit e600784

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

blocks/columns/columns.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ export default function decorate(block) {
1313
// for UE as value needs to be saved in different element due to having to walk the DOM tree to set the values
1414
const columnsChild = block.querySelector('div');
1515
const ueBkgdColorAttr = columnsChild?.getAttribute('data-background-color');
16-
console.log('7 bkgdColorAttr in columns row UE: ', ueBkgdColorAttr);
16+
console.log('8 bkgdColorAttr in columns row UE: ', ueBkgdColorAttr);
1717

1818
const ueTextColorAttr = columnsChild?.getAttribute('data-text-color');
19-
console.log('7 textColorAttr in columns row UE: ', ueTextColorAttr);
19+
console.log('8 textColorAttr in columns row UE: ', ueTextColorAttr);
2020

21-
if (ueBkgdColorAttr && ueBkgdColorAttr != null && (!block.style.backgroundColor || block.style.backgroundColor == 'white')) {
21+
if (ueBkgdColorAttr && ueBkgdColorAttr !== null && (!block.style.backgroundColor || block.style.backgroundColor == 'white')) {
22+
console.log('8, passing definition test: ', ueBkgdColorAttr, " passing null test: ", ueBkgdColorAttr !== null);
2223
block.style.backgroundColor = ueBkgdColorAttr;
2324
} else {
2425
block.style.backgroundColor = currentBkgdColor;
2526
}
26-
console.log('7 block.style.backgroundColor: ', block.style.backgroundColor);
27+
console.log('8 block.style.backgroundColor: ', block.style.backgroundColor);
2728
if (ueTextColorAttr && ueTextColorAttr != null && !block.style.color) block.style.color = ueTextColorAttr;
2829

2930
const cols = [...block.firstElementChild.children];

0 commit comments

Comments
 (0)