From 29eda89bc7577ad43d739c98607da9b13df22c54 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Mon, 21 Mar 2022 10:36:12 +0000 Subject: [PATCH] [FIX] web_editor: fix scrolling the page while dragging a snippet Since the commit [1], it's no longer possible to scroll the page while dragging a snippet thanks to its thumbnail. This is because for mass mailing the scroll element is not the same and to check it we were looking for a class in the DOM. For that we did a jQuery 'find' but without a 'length', the jQuery 'find' is always truthy. [1]: https://github.com/odoo/odoo/commit/29c6c80ac7009aa5068c763778342f7c6b115fad task-2798872 closes odoo/odoo#87021 X-original-commit: d4b231222c5baf726332deddfe6d4c5e3e7865db Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6d5719c3867..98f72589ccd 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -2403,7 +2403,7 @@ var SnippetsMenu = Widget.extend({ let dragAndDropResolve; let $scrollingElement = $().getScrollingElement(this.ownerDocument); - if (!$scrollingElement[0] || $scrollingElement.find('body.o_in_iframe')) { + if (!$scrollingElement[0] || $scrollingElement.find('body.o_in_iframe').length) { $scrollingElement = $(this.ownerDocument).find('.o_editable'); }