Explorar o código

ensure to specity revision id when saving with Ctrl+S

Yuki Takei %!s(int64=9) %!d(string=hai) anos
pai
achega
8e622e2d37
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      resource/js/legacy/crowi-form.js

+ 5 - 1
resource/js/legacy/crowi-form.js

@@ -374,8 +374,12 @@ $(function() {
 
 
     event.preventDefault();
     event.preventDefault();
 
 
+    const revisionInput = $('#page-form [name="pageForm[currentRevision]"]');
+
+    // generate data to post
     let data = {
     let data = {
       page_id: pageId,
       page_id: pageId,
+      revision_id: revisionInput.val(),
       body: $('#form-body').val(),
       body: $('#form-body').val(),
     }
     }
 
 
@@ -393,7 +397,7 @@ $(function() {
         });
         });
 
 
         // update currentRevision input
         // update currentRevision input
-        $('#page-form [name="pageForm[currentRevision]"]').val(page.revision._id);
+        revisionInput.val(page.revision._id);
 
 
         // TODO update $('#revision-body-content')
         // TODO update $('#revision-body-content')
       })
       })