summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorfja-odoo <fja@odoo.com>2019-09-10 13:17:11 +0000
committerfw-bot <otis@odoo.com>2019-09-12 15:45:58 +0000
commit6f14b488fb380c6a3f1b7361b9901de3f07fd9ea (patch)
tree5a0cc8ab94affad3dc77fa35d5a436779dfbbf7a /addons
parent459e6dc1d296c6fca11984c88046aa17ad32b026 (diff)
[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>
Diffstat (limited to 'addons')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js b/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js
index 4193aef5332..6077dcfafae 100644
--- a/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js
+++ b/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js
@@ -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);
+ },
});
}