Explorar o código

set 'submitOpts.overwriteScopesOfDescendants' param when post to /_api/pages.update

Yuki Takei %!s(int64=7) %!d(string=hai) anos
pai
achega
ca88faa70b
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/client/js/app.js

+ 4 - 1
src/client/js/app.js

@@ -213,7 +213,7 @@ const saveWithSubmitButtonSuccessHandler = function() {
   location.href = pagePath;
   location.href = pagePath;
 };
 };
 
 
-const saveWithSubmitButton = function() {
+const saveWithSubmitButton = function(submitOpts) {
   const editorMode = crowi.getCrowiForJquery().getCurrentEditorMode();
   const editorMode = crowi.getCrowiForJquery().getCurrentEditorMode();
   if (editorMode == null) {
   if (editorMode == null) {
     // do nothing
     // do nothing
@@ -225,6 +225,9 @@ const saveWithSubmitButton = function() {
   const options = componentInstances.savePageControls.getCurrentOptionsToSave();
   const options = componentInstances.savePageControls.getCurrentOptionsToSave();
   options.socketClientId = socketClientId;
   options.socketClientId = socketClientId;
 
 
+  // set 'submitOpts.overwriteScopesOfDescendants' to options
+  options.overwriteScopesOfDescendants = submitOpts ? !!submitOpts.overwriteScopesOfDescendants : false;
+
   let promise = undefined;
   let promise = undefined;
   if (editorMode === 'hackmd') {
   if (editorMode === 'hackmd') {
     // get markdown
     // get markdown