From 48f9060a4627b706dafbe9f06d61ff8dca3d945b Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Wed, 22 Jan 2020 11:31:28 +0000 Subject: [PATCH] [FIX] web_editor: adapt drop zone direction in oe_structure Adapt drop zone direction when a snippet is dropped in an oe_structure within a snippet. Before that, the first and the last drop zone preview (when dropping a snippet in an oe_structure inside an other snippet) was vertical if the oe_structure width was smaller than his parent. Part of https://github.com/odoo/odoo/pull/40690 task-2118980 --- addons/web_editor/static/src/js/editor/snippets.editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 5e04dec432a..9a64abd4247 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1092,7 +1092,7 @@ var SnippetsMenu = Widget.extend({ style['display'] = 'inline-block'; } else if (float === 'left' || float === 'right' || (parentDisplay === 'flex' && parentFlex === 'row')) { style['float'] = float; - if (!isFullWidth($zone)) { + if (!isFullWidth($zone) && !$zone.hasClass('oe_structure')) { vertical = true; style['height'] = Math.max($zone.outerHeight(), 30) + 'px'; } @@ -1110,7 +1110,7 @@ var SnippetsMenu = Widget.extend({ style['display'] = 'inline-block'; } else if (float === 'left' || float === 'right' || (parentDisplay === 'flex' && parentFlex === 'row')) { style['float'] = float; - if (!isFullWidth($zone)) { + if (!isFullWidth($zone) && !$zone.hasClass('oe_structure')) { vertical = true; style['height'] = Math.max($zone.outerHeight(), 30) + 'px'; }