Updated WYSIWYG edtitor to be iOS scrollable

Fixes #1058
This commit is contained in:
Dan Brown 2019-06-16 11:55:01 +01:00
parent fbb2b7ac6a
commit 7b506447c7
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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;
} }