|
@@ -155,6 +155,8 @@ Object.keys(componentMappings).forEach((key) => {
|
|
|
* @param {object} page Page instance
|
|
* @param {object} page Page instance
|
|
|
*/
|
|
*/
|
|
|
const saveWithShortcutSuccessHandler = function(page) {
|
|
const saveWithShortcutSuccessHandler = function(page) {
|
|
|
|
|
+ const editorMode = crowi.getCrowiForJquery().getCurrentEditorMode();
|
|
|
|
|
+
|
|
|
// show toastr
|
|
// show toastr
|
|
|
toastr.success(undefined, 'Saved successfully', {
|
|
toastr.success(undefined, 'Saved successfully', {
|
|
|
closeButton: true,
|
|
closeButton: true,
|
|
@@ -178,12 +180,15 @@ const saveWithShortcutSuccessHandler = function(page) {
|
|
|
}
|
|
}
|
|
|
// re-render PageEditor component
|
|
// re-render PageEditor component
|
|
|
if (componentInstances.pageEditor != null) {
|
|
if (componentInstances.pageEditor != null) {
|
|
|
- componentInstances.pageEditor.setMarkdown(page.revision.body);
|
|
|
|
|
|
|
+ const updateEditorValue = (editorMode !== 'builtin');
|
|
|
|
|
+ componentInstances.pageEditor.setMarkdown(page.revision.body, updateEditorValue);
|
|
|
}
|
|
}
|
|
|
// set revision id to PageEditorByHackmd
|
|
// set revision id to PageEditorByHackmd
|
|
|
if (componentInstances.pageEditorByHackmd != null) {
|
|
if (componentInstances.pageEditorByHackmd != null) {
|
|
|
componentInstances.pageEditorByHackmd.setRevisionId(pageRevisionId);
|
|
componentInstances.pageEditorByHackmd.setRevisionId(pageRevisionId);
|
|
|
- componentInstances.pageEditorByHackmd.setMarkdown(page.revision.body);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const updateEditorValue = (editorMode !== 'hackmd');
|
|
|
|
|
+ componentInstances.pageEditorByHackmd.setMarkdown(page.revision.body, updateEditorValue);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -199,6 +204,11 @@ const errorHandler = function(error) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const saveWithShortcut = function(markdown) {
|
|
const saveWithShortcut = function(markdown) {
|
|
|
|
|
+ const editorMode = crowi.getCrowiForJquery().getCurrentEditorMode();
|
|
|
|
|
+ if (editorMode == null) {
|
|
|
|
|
+ // do nothing
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// get options
|
|
// get options
|
|
|
const options = componentInstances.savePageControls.getCurrentOptionsToSave();
|
|
const options = componentInstances.savePageControls.getCurrentOptionsToSave();
|
|
|
|
|
|
|
@@ -226,7 +236,6 @@ const saveWithSubmitButton = function() {
|
|
|
// do nothing
|
|
// do nothing
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// get options
|
|
// get options
|
|
|
const options = componentInstances.savePageControls.getCurrentOptionsToSave();
|
|
const options = componentInstances.savePageControls.getCurrentOptionsToSave();
|
|
|
|
|
|