diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-04-30 13:07:16 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-04-30 13:07:16 +0000 |
| commit | eb5e8d660a8e94849590537102ef4bc149c13562 (patch) | |
| tree | 67967c4a8f346385d447ab8fb385b5a8bb7b2ba2 /addons/web_editor/static/src | |
| parent | 622af0b7cc1d2366c0a5c6b98d0cb727b65189eb (diff) | |
[FIX] web_editor: allow d&d of blocks between flex elements
When dragging a snippet in the editor, drop zones are created at the
correct locations (e.g. between columns when dragging a column). Some
code is in charge of "cleaning" the created drop zones to, for example,
remove multiples ones which are at the same position. This code is also
currently removing the drop zones which are between two "non-block"
elements. This is preventing to swap form rows thanks to the form
builder as rows are "non-block" elements as they are flex elements.
This commit solves the problem by changing the "is non-block" condition
to "is inline" condition which is what was intended.
Note 1: rows became flex elements with BS4, that is why this is fixed
in 12.0.
Note 2: this could be back-ported in previous stable versions as this
actually preventing to drop snippets between tables, list
items, etc (all non-block elements) but this can be considered
as a limitation unless a real breaking case presents itself.
See task-1874350 which discovered the bug.
closes odoo/odoo#33054
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 2 |
1 files changed, 1 insertions, 1 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 1b787eb99b9..51beb939648 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -811,7 +811,7 @@ var SnippetsMenu = Widget.extend({ && (float_next === 'left' || float_next === 'right')) { zone.remove(); } else if (disp_prev !== null && disp_next !== null - && disp_prev !== 'block' && disp_next !== 'block') { + && disp_prev.indexOf('inline') >= 0 && disp_next.indexOf('inline') >= 0) { zone.remove(); } }); |
