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 113b0d6087b..05f046b6695 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -226,7 +226,11 @@ var SnippetEditor = Widget.extend({ } var _animationsCount = 0; - var postAnimationCover = _.throttle(() => this.cover(), 100); + var postAnimationCover = _.throttle(() => { + this.trigger_up('cover_update', { + overlayVisible: true, + }); + }, 100); this.$target.on('transitionstart.snippet_editor, animationstart.snippet_editor', () => { // We cannot rely on the fact each transition/animation start will // trigger a transition/animation end as the element may be removed @@ -2590,9 +2594,13 @@ var SnippetsMenu = Widget.extend({ * Called when the overlay dimensions/positions should be recomputed. * * @private + * @param {OdooEvent} ev */ - _onOverlaysCoverUpdate: function () { + _onOverlaysCoverUpdate: function (ev) { this.snippetEditors.forEach(editor => { + if (ev.data.overlayVisible) { + editor.toggleOverlayVisibility(true); + } editor.cover(); }); },