]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/vues/page-editor.js
Removing the selected image and clearing the dropdzone on dialog close.
[bookstack] / resources / assets / js / vues / page-editor.js
index 11413131f4920339d45b12ffb96531690b43d6ab..d33739b30828b4717695c3cce8a50ca288f5913f 100644 (file)
@@ -34,8 +34,9 @@ function mounted() {
         this.draftText = trans('entities.pages_editing_page');
     }
 
-    // Listen to save draft events from editor
+    // Listen to save events from editor
     window.$events.listen('editor-save-draft', this.saveDraft);
+    window.$events.listen('editor-save-page', this.savePage);
 
     // Listen to content changes from the editor
     window.$events.listen('editor-html-change', html => {
@@ -96,7 +97,7 @@ let methods = {
         window.$http.put(url, data).then(response => {
             draftErroring = false;
             let updateTime = moment.utc(moment.unix(response.data.timestamp)).toDate();
-            if (!this.isNewPageDraft) this.isUpdateDraft = true;
+            if (!this.isNewDraft) this.isUpdateDraft = true;
             this.draftNotifyChange(response.data.message + moment(updateTime).format('HH:mm'));
             lastSave = Date.now();
         }, errorRes => {
@@ -106,6 +107,9 @@ let methods = {
         });
     },
 
+    savePage() {
+        this.$el.closest('form').submit();
+    },
 
     draftNotifyChange(text) {
         this.draftText = text;