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 3955369690e..5c24a1804f8 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1152,6 +1152,7 @@ var SnippetsMenu = Widget.extend({ '.ui-autocomplete', '.modal .close', '.o_we_crop_widget', + '.transfo-container', ].join(', '); this.loadingTimers = {}; 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 062fdf47444..20fce9fbd2d 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -4173,6 +4173,7 @@ registry.ReplaceMedia = SnippetOptionWidget.extend({ */ registry.ImageTools = SnippetOptionWidget.extend({ crop() { + this.trigger_up('hide_overlay'); new weWidgets.ImageCropWidget(this, this.$target[0]).appendTo(this.options.wysiwyg.$editable); }, transform() { @@ -4180,6 +4181,7 @@ registry.ImageTools = SnippetOptionWidget.extend({ this.$target.removeData('transfo-destroy'); return; } + this.trigger_up('hide_overlay'); const document = this.$target[0].ownerDocument; this.$target.transfo({document}); const mousedown = mousedownEvent => { diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop_widget.js b/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop_widget.js index 5aaa7762ddf..4c9846b8b9f 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop_widget.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop_widget.js @@ -82,7 +82,6 @@ const ImageCropWidget = Widget.extend({ await loadImage(this.originalSrc, cropperImage); await activateCropper(cropperImage, this.aspectRatios[this.aspectRatio].value, this.media.dataset); - core.bus.trigger('deactivate_snippet'); this._onDocumentMousedown = this._onDocumentMousedown.bind(this); // We use capture so that the handler is called before other editor handlers