Skip to content

Commit 7330180

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

blocks/columns/columns.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ 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('9 bkgdColorAttr in columns row UE: ', ueBkgdColorAttr);
16+
console.log('10 bkgdColorAttr in columns row UE: ', ueBkgdColorAttr);
1717

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

2121
if (ueBkgdColorAttr && ueBkgdColorAttr !== null && (!block.style.backgroundColor || block.style.backgroundColor == 'white')) {
22-
console.log('9, passing definition test: ', ueBkgdColorAttr, " passing null test: ", ueBkgdColorAttr !== null);
22+
console.log('10, passing definition test: ', ueBkgdColorAttr, " passing null test: ", ueBkgdColorAttr !== null);
2323
block.style.backgroundColor = ueBkgdColorAttr;
2424
// } else {
2525
// console.log('9, failing definition test, resetting to currentBkgdColor: ', currentBkgdColor);
2626
// block.style.backgroundColor = currentBkgdColor;
2727
}
28-
console.log('9 block.style.backgroundColor: ', block.style.backgroundColor);
28+
console.log('10 block.style.backgroundColor: ', block.style.backgroundColor);
2929
if (ueTextColorAttr && ueTextColorAttr != null && !block.style.color) block.style.color = ueTextColorAttr;
3030

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

0 commit comments

Comments
 (0)