[FIX] web_editor: properly copy tables
A syntax error sometimes caused a traceback when copying a table. opw-3166159 closes odoo/odoo#112562 X-original-commit: 7fdeced319902e26ce33b5ffd0dd08957c484eb4 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -3323,11 +3323,11 @@ export class OdooEditor extends EventTarget {
|
||||
// cell that is itself selected, or if all its own cells are
|
||||
// selected.
|
||||
const isTableFullySelected =
|
||||
table.parentElement && closestElement(table.parentElement, 'td.o_selected_td') ||
|
||||
table.parentElement && !!closestElement(table.parentElement, 'td.o_selected_td') ||
|
||||
[...table.querySelectorAll('td')]
|
||||
.filter(td => closestElement(td, 'table') === table)
|
||||
.every(td => td.classList.contains('o_selected_td'));
|
||||
if (!isTableFullySelected(table)) {
|
||||
if (!isTableFullySelected) {
|
||||
for (const td of tableClone.querySelectorAll('td:not(.o_selected_td)')) {
|
||||
if (closestElement(td, 'table') === tableClone) { // ignore nested
|
||||
td.remove();
|
||||
|
||||
Reference in New Issue
Block a user