[FIX] web_editor: keep div inline styles on convert to table

When converting a div to a table, we apply some styles to undo the
table's default styles. This makes sure these styles don't override any
inline styles the div might have been holding.

X-original-commit: 0fad86b330a0e1a3228bbbe76fd2b7370cff3eb0
Part-of: odoo/odoo#80621
This commit is contained in:
Antoine Guenet
2021-12-08 09:35:00 +00:00
parent b0278a0221
commit 23df5ab4ed
@@ -385,7 +385,11 @@ function _createTable(attributes = []) {
delete layoutStyles['line-height'];
$table.css(layoutStyles);
} else {
$table.css(tableStyles);
for (const styleName in tableStyles) {
if (!('style' in attributes && attributes.style.value.includes(styleName + ':'))) {
$table.css(styleName, tableStyles[styleName]);
}
}
}
return $table;
}