mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
parent
fbb2b7ac6a
commit
7b506447c7
@ -69,8 +69,8 @@ let methods = {
|
|||||||
autoSave = window.setInterval(() => {
|
autoSave = window.setInterval(() => {
|
||||||
// Return if manually saved recently to prevent bombarding the server
|
// Return if manually saved recently to prevent bombarding the server
|
||||||
if (Date.now() - lastSave < (1000 * autoSaveFrequency)/2) return;
|
if (Date.now() - lastSave < (1000 * autoSaveFrequency)/2) return;
|
||||||
let newTitle = document.getElementById('name').value.trim();
|
const newTitle = document.getElementById('name').value.trim();
|
||||||
let newHtml = this.editorHTML;
|
const newHtml = this.editorHTML;
|
||||||
|
|
||||||
if (newTitle !== currentContent.title || newHtml !== currentContent.html) {
|
if (newTitle !== currentContent.title || newHtml !== currentContent.html) {
|
||||||
currentContent.html = newHtml;
|
currentContent.html = newHtml;
|
||||||
@ -84,18 +84,18 @@ let methods = {
|
|||||||
saveDraft() {
|
saveDraft() {
|
||||||
if (!this.draftsEnabled) return;
|
if (!this.draftsEnabled) return;
|
||||||
|
|
||||||
let data = {
|
const data = {
|
||||||
name: document.getElementById('name').value.trim(),
|
name: document.getElementById('name').value.trim(),
|
||||||
html: this.editorHTML
|
html: this.editorHTML
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.editorType === 'markdown') data.markdown = this.editorMarkdown;
|
if (this.editorType === 'markdown') data.markdown = this.editorMarkdown;
|
||||||
|
|
||||||
let url = window.baseUrl(`/ajax/page/${this.pageId}/save-draft`);
|
const url = window.baseUrl(`/ajax/page/${this.pageId}/save-draft`);
|
||||||
window.$http.put(url, data).then(response => {
|
window.$http.put(url, data).then(response => {
|
||||||
draftErroring = false;
|
draftErroring = false;
|
||||||
if (!this.isNewDraft) this.isUpdateDraft = true;
|
if (!this.isNewDraft) this.isUpdateDraft = true;
|
||||||
this.draftNotifyChange(`${response.data.message } ${Dates.utcTimeStampToLocalTime(response.data.timestamp)}`);
|
this.draftNotifyChange(`${response.data.message} ${Dates.utcTimeStampToLocalTime(response.data.timestamp)}`);
|
||||||
lastSave = Date.now();
|
lastSave = Date.now();
|
||||||
}, errorRes => {
|
}, errorRes => {
|
||||||
if (draftErroring) return;
|
if (draftErroring) return;
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
display: flex !important;
|
display: flex !important;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
-webkit-overflow-scrolling:touch;
|
||||||
|
overflow:auto;
|
||||||
iframe {
|
iframe {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user