Commit 6fcd0a54 authored by Jeroen Hoffman's avatar Jeroen Hoffman

CMS-11245 [back port CMS-11136 to 11.2] same logic for "Save all" as for...

CMS-11245 [back port CMS-11136 to 11.2] same logic for "Save all" as for "Discard all" in order to not confusingly cancel documents on "Save all"

(cherry picked from commit b19acb38)
parent 4e36e8c7
......@@ -670,7 +670,9 @@ public class TabsPlugin extends RenderPlugin {
if (editor != null) {
try {
if (editor.isModified() || editor.getMode() == IEditor.Mode.EDIT) {
editor.discard(); ///discard the document and switch to VIEW mode
// (mode=edit means open but unmodified)
// discard the document and switch to VIEW mode
editor.discard();
}
editor.close();
} catch (EditorException e) {
......@@ -690,10 +692,10 @@ public class TabsPlugin extends RenderPlugin {
final IEditor editor = currentTab.getEditor();
if (editor != null){
try {
if (editor.isModified()) {
editor.done(); //save the document and switch to VIEW mode
} else if (editor.getMode() == IEditor.Mode.EDIT) {
editor.discard();
if (editor.isModified() || editor.getMode() == IEditor.Mode.EDIT) {
// (mode=edit means open but unmodified)
// save the document and switch to VIEW mode
editor.done();
}
editor.close();
} catch (EditorException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment