From d593fdbf5802e672520f73f249ece5e03b4b88cf Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Wed, 2 Sep 2020 08:18:28 +0000 Subject: [PATCH] [FIX] web_editor: hide the remove button for image t-field task-2312878 closes odoo/odoo#58396 X-original-commit: 812280896120a9950363c2cd775a49d2ac3a8695 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index e7d685262bc..f464cbe4c3a 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -72,6 +72,7 @@ var SnippetEditor = Widget.extend({ this.isTargetParentEditable = this.$target.parent().is(':o_editable'); this.isTargetMovable = this.isTargetParentEditable && this.isTargetMovable; + this.isTargetRemovable = this.isTargetParentEditable && !this.$target.parent().is('[data-oe-type="image"]'); // Initialize move/clone/remove buttons if (this.isTargetMovable) { @@ -106,7 +107,7 @@ var SnippetEditor = Widget.extend({ $customize.find('.oe_snippet_clone').addClass('d-none'); } - if (!this.isTargetParentEditable) { + if (!this.isTargetRemovable) { this.$el.add($customize).find('.oe_snippet_remove').addClass('d-none'); }