[FIX] web_editor: fix error on section drag and drop

closes odoo/odoo#36801

X-original-commit: 0ae223609a860799135e7f6764c4cb8a08979b12
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
fja-odoo
2019-09-12 15:45:58 +00:00
committed by fw-bot
parent 459e6dc1d2
commit 6f14b488fb
@@ -88,7 +88,16 @@ var SnippetEditor = Widget.extend({
return $clone;
},
start: _.bind(self._onDragAndDropStart, self),
stop: _.bind(self._onDragAndDropStop, self)
stop: function () {
// Delay our stop handler so that some summernote handlers
// which occur on mouseup (and are themself delayed) are
// executed first (this prevents the library to crash
// because our stop handler may change the DOM).
var args = arguments;
setTimeout(function () {
self._onDragAndDropStop.apply(self, args);
}, 0);
},
});
}