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); }, });