X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/d41452f39c90deaca98b4fe0e8c87f7d7aa395b8..refs/pull/3000/head:/resources/js/components/attachments.js diff --git a/resources/js/components/attachments.js b/resources/js/components/attachments.js index 51e54054e..6dcfe9f12 100644 --- a/resources/js/components/attachments.js +++ b/resources/js/components/attachments.js @@ -33,6 +33,15 @@ class Attachments { this.container.addEventListener('event-emit-select-edit-back', event => { this.stopEdit(); }); + + this.container.addEventListener('event-emit-select-insert', event => { + const insertContent = event.target.closest('[data-drag-content]').getAttribute('data-drag-content'); + const contentTypes = JSON.parse(insertContent); + window.$events.emit('editor::insert', { + html: contentTypes['text/html'], + markdown: contentTypes['text/plain'], + }); + }); } reloadList() {