Commit 4e36e8c7 authored by Jasper Floor's avatar Jasper Floor Committed by Jeroen Hoffman

CMS-11245 [back port CMS-11136 to 11.2] properly handle document state on...

CMS-11245 [back port CMS-11136 to 11.2] properly handle document state on editor close for bulk tab actions

(cherry picked from commit f120d6ab)
parent 7d10c486
/*
* Copyright 2008-2017 Hippo B.V. (http://www.onehippo.com)
* Copyright 2008-2018 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -669,7 +669,7 @@ public class TabsPlugin extends RenderPlugin {
final IEditor editor = currentTab.getEditor();
if (editor != null) {
try {
if (editor.isModified()) {
if (editor.isModified() || editor.getMode() == IEditor.Mode.EDIT) {
editor.discard(); ///discard the document and switch to VIEW mode
}
editor.close();
......@@ -692,6 +692,8 @@ public class TabsPlugin extends RenderPlugin {
try {
if (editor.isModified()) {
editor.done(); //save the document and switch to VIEW mode
} else if (editor.getMode() == IEditor.Mode.EDIT) {
editor.discard();
}
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