X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/2f6ff0734773c4ac009de699a2661971fd585b22..refs/pull/2336/head:/resources/js/components/markdown-editor.js diff --git a/resources/js/components/markdown-editor.js b/resources/js/components/markdown-editor.js index 6e646c72b..19d26d4a9 100644 --- a/resources/js/components/markdown-editor.js +++ b/resources/js/components/markdown-editor.js @@ -256,7 +256,7 @@ class MarkdownEditor { } const clipboard = new Clipboard(event.dataTransfer); - if (clipboard.hasItems()) { + if (clipboard.hasItems() && clipboard.getImages().length > 0) { const cursorPos = cm.coordsChar({left: event.pageX, top: event.pageY}); cm.setCursor(cursorPos); event.stopPropagation(); @@ -440,10 +440,10 @@ class MarkdownEditor { const data = { image: pngData, - uploaded_to: Number(document.getElementById('page-editor').getAttribute('page-id')) + uploaded_to: Number(this.pageId), }; - window.$http.post(window.baseUrl('/images/drawio'), data).then(resp => { + window.$http.post("/images/drawio", data).then(resp => { this.insertDrawing(resp.data, cursorPos); DrawIO.close(); }).catch(err => { @@ -476,10 +476,10 @@ class MarkdownEditor { let data = { image: pngData, - uploaded_to: Number(document.getElementById('page-editor').getAttribute('page-id')) + uploaded_to: Number(this.pageId), }; - window.$http.post(window.baseUrl(`/images/drawio`), data).then(resp => { + window.$http.post("/images/drawio", data).then(resp => { let newText = `