From 7b92e13533c7bd85cfa5c35e523ab76faf9c50f0 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 23 Sep 2019 09:00:45 +0000 Subject: [PATCH] [FIX] web_editor: fix section drag and drop error (2) Forward-port of https://github.com/odoo/odoo/commit/6f14b488fb380c6a3f1b7361b9901de3f07fd9ea was not properly done. --- addons/web_editor/static/src/js/editor/snippets.editor.js | 7 +++---- 1 file changed, 3 insertions(+), 4 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 b94c7108122..74cf4ce7040 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -77,14 +77,13 @@ var SnippetEditor = Widget.extend({ return $clone; }, start: this._onDragAndDropStart.bind(this), - stop: function () { + stop: (...args) => { // 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); + setTimeout(() => { + this._onDragAndDropStop(...args); }, 0); }, });