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 35e60a58998..e218b59b974 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -273,7 +273,9 @@ var SnippetEditor = Widget.extend({ top: offset.top, }); this.$('.o_handles').css('height', $target.outerHeight()); - this.$el.toggleClass('o_top_cover', offset.top < this.$editable.offset().top); + + const editableOffsetTop = this.$editable.offset().top - manipulatorOffset.top; + this.$el.toggleClass('o_top_cover', offset.top - editableOffsetTop < 25); }, /** * DOMElements have a default name which appears in the overlay when they @@ -899,7 +901,7 @@ var SnippetEditor = Widget.extend({ /** * Called when the 'mouse wheel' is used when hovering over the overlay. * Disable the pointer events to prevent page scrolling from stopping. - * + * * @private * @param {Event} ev */ diff --git a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss index ff339959c07..f0a12064d1d 100644 --- a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss +++ b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss @@ -1788,6 +1788,12 @@ body.editor_enable.editor_has_snippets { } } + &.o_top_cover > .o_handles > .o_overlay_options_wrap { + top: auto; + bottom: -$o-we-handles-offset-to-hide; + transform: translate(-50%, 110%); + } + &.o_we_overlay_preview { pointer-events: none;