From 21d230abca6867681c2c8665e1ef20e41564128c Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 4 Nov 2019 16:27:19 +0000 Subject: [PATCH] [FIX] web_editor: prevent deleting carousel-item with the delete button Indeed, the carousel-item elements are linked to other DOM (like indicators) and removing one would imply enabling another one... all of this is handled by the carousel "remove slide" option. Note: the UI to add and remove slides will be refactored in a future update of this future saas anyway. Part of https://github.com/odoo/odoo/pull/38997 task-2090180 closes odoo/odoo#38997 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 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 0ebf61e14d7..f0b1b1e2549 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -97,7 +97,7 @@ var SnippetEditor = Widget.extend({ $customize.find('.oe_snippet_clone').addClass('d-none'); } - if (!this.isTargetParentEditable) { + if (!this.isTargetParentEditable || this.$target.is('.carousel-item')) { // TODO get rid of the carousel-item hack somehow $customize.find('.oe_snippet_remove').addClass('d-none'); }