0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-17 22:02:05 +00:00

Added button for inserting attachment link to a page

For 
This commit is contained in:
Dan Brown 2020-09-13 18:58:05 +01:00
parent ad48cd3e48
commit 09c6d6c722
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
5 changed files with 31 additions and 1 deletions
resources/js/components

View file

@ -563,6 +563,12 @@ class MarkdownEditor {
this.cm.setCursor(cursorPos.line + prependLineCount, cursorPos.ch);
});
// Insert editor content at the current location
window.$events.listen('editor::insert', (eventContent) => {
const markdown = getContentToInsert(eventContent);
this.cm.replaceSelection(markdown);
});
// Focus on editor
window.$events.listen('editor::focus', () => {
this.cm.focus();