From 2750bfa97f2625e34da15281c23a46e526d32935 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Fri, 12 Nov 2021 13:33:56 +0000 Subject: [PATCH] [IMP] web_editor: no empty class on convert grid X-original-commit: 731ffadb08961b6aada283f96d82c0a35726cffe Part-of: odoo/odoo#80621 --- .../web_editor/static/src/js/backend/convert_inline.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index 8d1590f94b0..627c3a8e2af 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -424,6 +424,9 @@ function bootstrapToTable($editable) { $table.append(child); } $table.removeClass('container container-fluid o_fake_table'); + if (!$table[0].className) { + $table.removeAttr('class'); + } $container.before($table); $container.remove(); @@ -440,6 +443,9 @@ function bootstrapToTable($editable) { $row.attr(attr.name, attr.value); } $row.removeClass('row'); + if (!$row[0].className) { + $row.removeAttr('class'); + } for (const child of [...bootstrapRow.childNodes]) { $row.append(child); } @@ -515,6 +521,9 @@ function bootstrapToTable($editable) { } const colMatch = bootstrapColumn.className.match(reColMatch); $currentCol.removeClass(colMatch[0]); + if (!$currentCol[0].className) { + $currentCol.removeAttr('class'); + } for (const child of [...bootstrapColumn.childNodes]) { $currentCol.append(child); }