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 57cf4593584..9f093ae8751 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -13,7 +13,7 @@ import {getCSSVariableValue} from "web_editor.utils"; import * as gridUtils from "@web_editor/js/common/grid_layout_utils"; import { sprintf, escape } from "@web/core/utils/strings"; const QWeb = core.qweb; -import {closestElement} from "@web_editor/js/editor/odoo-editor/src/utils/utils"; +import { closestElement, isUnremovable } from "@web_editor/js/editor/odoo-editor/src/utils/utils"; import { debounce, throttleForAnimation } from "@web/core/utils/timing"; import { uniqueId } from "@web/core/utils/functions"; import { sortBy, unique } from "@web/core/utils/arrays"; @@ -201,7 +201,7 @@ var SnippetEditor = Widget.extend({ this.isTargetParentEditable = this.$target.parent().is(':o_editable'); this.isTargetMovable = this.isTargetParentEditable && this.isTargetMovable && !this.$target.hasClass('oe_unmovable'); - this.isTargetRemovable = this.isTargetParentEditable && !this.$target.parent().is('[data-oe-type="image"]') && !this.$target.hasClass('oe_unremovable'); + this.isTargetRemovable = this.isTargetParentEditable && !this.$target.parent().is('[data-oe-type="image"]') && !isUnremovable(this.$target[0]); this.displayOverlayOptions = this.displayOverlayOptions || this.isTargetMovable || !this.isTargetParentEditable; // Initialize move/clone/remove buttons @@ -555,9 +555,10 @@ var SnippetEditor = Widget.extend({ // Consider layout-only elements (like bg-shapes) as empty return el.matches(this.layoutElementsSelector); }); - return isEmpty && !$el.hasClass('oe_structure') && !$el.hasClass('oe_unremovable') + return isEmpty && !$el.hasClass('oe_structure') && !$el.parent().hasClass('carousel-item') - && (!editor || editor.isTargetParentEditable); + && (!editor || editor.isTargetParentEditable) + && !isUnremovable($el[0]); }; var editor = $parent.data('snippet-editor');