[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
This commit is contained in:
Benjamin Vray
2020-01-30 16:56:56 +00:00
committed by qsm-odoo
parent 8d3d32ec44
commit 48f9060a46
@@ -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';
}