]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/attachments.js
Fixed permission row permission check
[bookstack] / resources / js / components / attachments.js
index 51e54054ebabba076089798a3c7591088ac18caa..6dcfe9f128cf39a8e7a2d0586b32b9320613c5f8 100644 (file)
@@ -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() {