Skip to content
Snippets Groups Projects
Commit 0cfe0b58 authored by Younn Olivier's avatar Younn Olivier
Browse files

[FIX] web_editor: display drop zones only on dropdowns when shown


It was painful to add an inline snippets, or move elements inside mega
menus. The dropdowns are now behaving as such: if they are shown, the
user can only add or move snippets inside them, but not outside.

task-2668908

closes odoo/odoo#80603

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 2939040a
No related branches found
No related tags found
No related merge requests found
......@@ -927,6 +927,15 @@ var SnippetsMenu = Widget.extend({
_activateInsertionZones: function ($selectorSiblings, $selectorChildren) {
var self = this;
// If a dropdown is shown, the drop zones must be created only in this
// element.
const $editableArea = self.getEditableArea();
const $dropdown = $editableArea.find('.dropdown-menu.show').addBack('.dropdown-menu.show').parent();
if ($dropdown.length) {
$selectorSiblings = $dropdown.find($selectorSiblings);
$selectorChildren = $dropdown.find($selectorChildren);
}
// Check if the drop zone should be horizontal or vertical
function setDropZoneDirection($elem, $parent, $sibling) {
var vertical = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment