mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-26 10:13:38 +08:00
Fixed error on drawing edit on markdown editor
Was preventing save of drawings. For #2313
This commit is contained in:
parent
f3ee8f2d4c
commit
bb1f1a9ecd
|
@ -440,10 +440,10 @@ class MarkdownEditor {
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
image: pngData,
|
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);
|
this.insertDrawing(resp.data, cursorPos);
|
||||||
DrawIO.close();
|
DrawIO.close();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
@ -476,10 +476,10 @@ class MarkdownEditor {
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
image: pngData,
|
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 = `<div drawio-diagram="${resp.data.id}"><img src="${resp.data.url}"></div>`;
|
let newText = `<div drawio-diagram="${resp.data.id}"><img src="${resp.data.url}"></div>`;
|
||||||
let newContent = this.cm.getValue().split('\n').map(line => {
|
let newContent = this.cm.getValue().split('\n').map(line => {
|
||||||
if (line.indexOf(`drawio-diagram="${drawingId}"`) !== -1) {
|
if (line.indexOf(`drawio-diagram="${drawingId}"`) !== -1) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user