X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/18f406d97bfb0583e49e195817dd8a274cb0619d..refs/pull/2257/head:/resources/js/components/wysiwyg-editor.js diff --git a/resources/js/components/wysiwyg-editor.js b/resources/js/components/wysiwyg-editor.js index 92a678fbd..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,8 +643,8 @@ class WysiwygEditor { }); + // Custom drop event handling editor.on('drop', function (event) { - console.log('drop') let dom = editor.dom, rng = tinymce.dom.RangeUtils.getCaretRangeFromPoint(event.clientX, event.clientY, editor.getDoc());