X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/03211ebea6b26b29ad2c28a9833c61a4ff9581a4..refs/pull/2283/head:/resources/js/components/wysiwyg-editor.js diff --git a/resources/js/components/wysiwyg-editor.js b/resources/js/components/wysiwyg-editor.js index 98a5e95c4..a32e78161 100644 --- a/resources/js/components/wysiwyg-editor.js +++ b/resources/js/components/wysiwyg-editor.js @@ -401,6 +401,11 @@ function listenForBookStackEditorEvents(editor) { editor.setContent(content); }); + // Insert editor content at the current location + window.$events.listen('editor::insert', ({html}) => { + editor.insertContent(html); + }); + // Focus on the editor window.$events.listen('editor::focus', () => { editor.focus(); @@ -638,6 +643,7 @@ class WysiwygEditor { }); + // Custom drop event handling editor.on('drop', function (event) { let dom = editor.dom, rng = tinymce.dom.RangeUtils.getCaretRangeFromPoint(event.clientX, event.clientY, editor.getDoc());