summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-08-27 14:45:59 +0000
committerqsm-odoo <qsm@odoo.com>2019-08-28 09:04:18 +0000
commit7acb22a5e5c9beceb18ed6fea691e14502b93ad7 (patch)
tree4c19f5cc8699a4fd72305e087fb78831c67e0962 /addons/web_editor/static/src
parent5f35819fff8090a3040edee3bc62b5078737403f (diff)
[FIX] web_editor: restore moving snippets to nearest dropzone
Hard to say when this was broken since the current work and revert of the editor: when dropping a snippet outside of a dropzone it was not dropped in the nearest one anymore because the dropzones were somehow destroyed first in the current code. Part of https://github.com/odoo/odoo/pull/36068 Discovered while working on task-1942370
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js4
1 files 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 4fba95f2490..d79e0a9a2cc 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -446,8 +446,6 @@ var SnippetEditor = Widget.extend({
* @param {Object} ui
*/
_onDragAndDropStop: function (ev, ui) {
- this.$editable.find('.oe_drop_zone').droppable('destroy').remove();
-
// TODO lot of this is duplicated code of the d&d feature of snippets
if (!this.dropped) {
var $el = $.nearest({x: ui.position.left, y: ui.position.top}, '.oe_drop_zone', {container: document.body}).first();
@@ -457,6 +455,8 @@ var SnippetEditor = Widget.extend({
}
}
+ this.$editable.find('.oe_drop_zone').droppable('destroy').remove();
+
var prev = this.$target.first()[0].previousSibling;
var next = this.$target.last()[0].nextSibling;
var $parent = this.$target.parent();