summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGoaman <nby@odoo.com>2019-08-07 10:13:13 +0000
committerGoaman <nby@odoo.com>2019-08-07 15:00:25 +0000
commitb384a00fe26131d716dd0c87f3fcf0a164f95aee (patch)
tree1430305e90c93b2fd0e2d1937296c997ca91fa7e /addons
parentd0e80593304415b605bc28f00239a391604a4fcf (diff)
[FIX] web_editor: Do not remove block
Do not remove block in _removeNextEmptyUnbreakable. Before this commit, when you tried to remove insert a character in a td, with an empty td after the first one. The function _removeNextEmptyUnbreakable removed the empty td. It was for example breaking snippet in the website and mass_mailing. closes odoo/odoo#32096 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js b/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
index 141d4c1bf2e..9ac05220e45 100644
--- a/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
+++ b/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
@@ -827,7 +827,7 @@ var KeyboardPlugin = AbstractPlugin.extend({
}
},
/**
- * Remove the first unbreakable ancestor's next sibling if empty.
+ * Remove the first unbreakable ancestor's next sibling if not a block and empty.
*
* @private
* @param {Node} node
@@ -843,7 +843,7 @@ var KeyboardPlugin = AbstractPlugin.extend({
var isNextContainsOnlyInvisibleText = nextUnbreakable && _.all($(nextUnbreakable).contents(), function (n) {
return dom.isText(n) && !self.context.invoke('HelperPlugin.isVisibleText', n);
});
- if (isNextEmpty || isNextContainsOnlyInvisibleText) {
+ if (!dom.isBlock(nextUnbreakable) && (isNextEmpty || isNextContainsOnlyInvisibleText)) {
$(nextUnbreakable).remove();
}
},