diff options
| author | Benjamin Vray <bvr@odoo.com> | 2020-11-19 15:30:09 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2021-01-27 14:51:32 +0000 |
| commit | 2f38816f279717bca38166a22c4f692a7f1d10c0 (patch) | |
| tree | 013ac2b7af9491d4992aa37e2ef8d5791dcacc39 /addons/web_editor/static/src/js/editor | |
| parent | e734df614a07d51cfd2c9eb6e3876189e1d22a69 (diff) | |
[FIX] web_editor: fix drag and drop a snippet in a modal
When a modal is open, allow the drop of a snippet only in this
modal.
Part of https://github.com/odoo/odoo/pull/61998
task-2312878
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 7 |
1 files changed, 7 insertions, 0 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 577132a6f27..f19764dce46 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1261,6 +1261,13 @@ var SnippetsMenu = Widget.extend({ _activateInsertionZones: function ($selectorSiblings, $selectorChildren) { var self = this; + // If a modal is open, the drop zones must be created only in this modal + const $openModal = self.getEditableArea().find('.modal:visible'); + if ($openModal.length) { + $selectorSiblings = $openModal.find($selectorSiblings); + $selectorChildren = $openModal.find($selectorChildren); + } + // Check if the drop zone should be horizontal or vertical function setDropZoneDirection($elem, $parent, $sibling) { var vertical = false; |
