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 cbf53477829..cc8db13d61a 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -780,6 +780,7 @@ var SnippetEditor = Widget.extend({ if (option.forceNoDeleteButton) { this.$el.add($optionsSection).find('.oe_snippet_remove').addClass('d-none'); + this.$el.add($optionsSection).find('.oe_snippet_clone').addClass('d-none'); } if (option.displayOverlayOptions) { diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index c59a820068e..6fa396b3aa3 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -3253,7 +3253,8 @@ const SnippetOptionWidget = Widget.extend({ */ isTopFirstOption: false, /** - * Forces the target to not be possible to remove. + * Forces the target to not be possible to remove. It will also hide the + * clone button. * * @type {boolean} */ diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index cb1dc759999..b769c6775e1 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -3882,7 +3882,7 @@ options.registry.MegaMenuLayout = options.registry.SelectTemplate.extend({ }); /** - * Hides delete button for Mega Menu block. + * Hides delete and clone buttons for Mega Menu block. */ options.registry.MegaMenuNoDelete = options.Class.extend({ forceNoDeleteButton: true, diff --git a/addons/website/static/src/snippets/s_table_of_content/options.js b/addons/website/static/src/snippets/s_table_of_content/options.js index 9fb04952dde..1b15cf441a7 100644 --- a/addons/website/static/src/snippets/s_table_of_content/options.js +++ b/addons/website/static/src/snippets/s_table_of_content/options.js @@ -192,13 +192,4 @@ options.registry.TableOfContentNavbar = options.Class.extend({ options.registry.TableOfContentMainColumns = options.Class.extend({ forceNoDeleteButton: true, - - /** - * @override - */ - start: function () { - const leftPanelEl = this.$overlay.data('$optionsSection')[0]; - leftPanelEl.querySelector('.oe_snippet_clone').classList.add('d-none'); // TODO improve the way to do that - return this._super.apply(this, arguments); - }, });