[FIX] web_editor: prevent infinite scroll in mass_mailing in dialogs

When opening mass_mailing in a dialog (eg, in marketing automation),
dragging a snippet to the bottom of the page (without dropping) caused
an infinitely growing scrollbar on the document element.

Note: this revealed that in that particular context the auto scroll to
snippet feature is broken and while dragging we have an extra scrollbar,
on the editable area. In order to fix that, we need to be able to
identify from within the iframe the case where mass_mailing
self-resizes. This involves changing the view to add an option which
will set a class on the document element. This is not acceptable in
stable and will therefore be fixed in master instead.

task-2742664

closes odoo/odoo#86506

X-original-commit: 29c6c80ac7009aa5068c763778342f7c6b115fad
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Antoine Guenet
2022-03-16 16:07:22 +01:00
parent 8fb3cbed2a
commit f50eaa4412
@@ -2403,7 +2403,7 @@ var SnippetsMenu = Widget.extend({
let dragAndDropResolve;
let $scrollingElement = $().getScrollingElement(this.ownerDocument);
if (!$scrollingElement[0]) {
if (!$scrollingElement[0] || $scrollingElement.find('body.o_in_iframe')) {
$scrollingElement = $(this.ownerDocument).find('.o_editable');
}