From: Dan Brown Date: Tue, 13 Oct 2020 21:36:07 +0000 (+0100) Subject: Fixed error on drawing edit on markdown editor X-Git-Tag: v0.30.3~1^2~4 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/bb1f1a9ecd1687e867b40f7f4a3441bce825e979?ds=inline;hp=-c Fixed error on drawing edit on markdown editor Was preventing save of drawings. For #2313 --- bb1f1a9ecd1687e867b40f7f4a3441bce825e979 diff --git a/resources/js/components/markdown-editor.js b/resources/js/components/markdown-editor.js index c371a9839..19d26d4a9 100644 --- a/resources/js/components/markdown-editor.js +++ b/resources/js/components/markdown-editor.js @@ -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 = `
`; let newContent = this.cm.getValue().split('\n').map(line => { if (line.indexOf(`drawio-diagram="${drawingId}"`) !== -1) {