diff --git a/src/main/java/org/olat/core/gui/components/tree/MenuTreeItem.java b/src/main/java/org/olat/core/gui/components/tree/MenuTreeItem.java index 0593714134f7a2c43d3759904da934ab14ee475f..4b53c442779570e9134328a191ba12f8e4f0eae5 100644 --- a/src/main/java/org/olat/core/gui/components/tree/MenuTreeItem.java +++ b/src/main/java/org/olat/core/gui/components/tree/MenuTreeItem.java @@ -40,6 +40,7 @@ import org.olat.course.tree.TreePosition; public class MenuTreeItem extends FormItemImpl { private final MenuTree treeCmp; + private boolean noDirtyCheckOnClick = false; private Set<String> visibleNodeIds = new HashSet<>(); public MenuTreeItem(String name, ComponentEventListener listener) { @@ -47,6 +48,14 @@ public class MenuTreeItem extends FormItemImpl { treeCmp = new MenuTree(null, name + "_CMP", listener, this); } + public boolean isNoDirtyCheckOnClick() { + return noDirtyCheckOnClick; + } + + public void setNoDirtyCheckOnClick(boolean noDirtyCheckOnClick) { + this.noDirtyCheckOnClick = noDirtyCheckOnClick; + } + @Override protected MenuTree getFormItemComponent() { return treeCmp; diff --git a/src/main/java/org/olat/core/gui/components/tree/MenuTreeRenderer.java b/src/main/java/org/olat/core/gui/components/tree/MenuTreeRenderer.java index 001ddd044b8b8aebc626e2f20382b4c222a4b259..9c00f6d2859e353ae520860b9d1d6ef8f1231dcd 100644 --- a/src/main/java/org/olat/core/gui/components/tree/MenuTreeRenderer.java +++ b/src/main/java/org/olat/core/gui/components/tree/MenuTreeRenderer.java @@ -352,7 +352,11 @@ public class MenuTreeRenderer extends DefaultComponentRenderer { } // add css class to identify level, FireFox script - target.append("<a onclick='o2cl_secure()' href=\""); + if(tree.getMenuTreeItem() != null && tree.getMenuTreeItem().isNoDirtyCheckOnClick()) { + target.append("<a onclick='o2cl_noDirtyCheck()' href=\""); + } else { + target.append("<a onclick='o2cl_secure()' href=\""); + } // Build menu item URI if (iframePostEnabled) { diff --git a/src/main/java/org/olat/course/assessment/ui/AssessmentModeEditController.java b/src/main/java/org/olat/course/assessment/ui/AssessmentModeEditController.java index de82f94c8d3abe4739b2ecaebcec555d71651f78..2af7255134739f981e37ddba2897671a713e3b68 100644 --- a/src/main/java/org/olat/course/assessment/ui/AssessmentModeEditController.java +++ b/src/main/java/org/olat/course/assessment/ui/AssessmentModeEditController.java @@ -636,7 +636,7 @@ public class AssessmentModeEditController extends FormBasicController { listenTo(chooseElementsCtrl); cmc = new CloseableModalController(getWindowControl(), "close", chooseElementsCtrl.getInitialComponent(), - true, getTranslator().translate("popup.chooseelements")); + true, translate("popup.chooseelements"), false); listenTo(cmc); cmc.activate(); } @@ -647,8 +647,8 @@ public class AssessmentModeEditController extends FormBasicController { chooseStartElementCtrl = new ChooseStartElementController(ureq, getWindowControl(), startElementKey, courseOres); listenTo(chooseStartElementCtrl); - cmc = new CloseableModalController(getWindowControl(), "close", chooseStartElementCtrl.getInitialComponent(), - true, getTranslator().translate("popup.choosestartelement")); + cmc = new CloseableModalController(getWindowControl(), null, chooseStartElementCtrl.getInitialComponent(), + true, translate("popup.choosestartelement"), false); listenTo(cmc); cmc.activate(); } @@ -661,8 +661,8 @@ public class AssessmentModeEditController extends FormBasicController { areaChooseCtrl = new AreaSelectionController(ureq, getWindowControl(), true, groupManager, areaKeys); listenTo(areaChooseCtrl); - cmc = new CloseableModalController(getWindowControl(), "close", areaChooseCtrl.getInitialComponent(), - true, getTranslator().translate("popup.chooseareas")); + cmc = new CloseableModalController(getWindowControl(), null, areaChooseCtrl.getInitialComponent(), + true, translate("popup.chooseareas"), false); listenTo(cmc); cmc.activate(); } @@ -675,8 +675,8 @@ public class AssessmentModeEditController extends FormBasicController { groupChooseCtrl = new GroupSelectionController(ureq, getWindowControl(), true, groupManager, groupKeys); listenTo(groupChooseCtrl); - cmc = new CloseableModalController(getWindowControl(), "close", groupChooseCtrl.getInitialComponent(), - true, translate("popup.choosegroups")); + cmc = new CloseableModalController(getWindowControl(), null, groupChooseCtrl.getInitialComponent(), + true, translate("popup.choosegroups"), false); listenTo(cmc); cmc.activate(); } diff --git a/src/main/java/org/olat/course/assessment/ui/ChooseStartElementController.java b/src/main/java/org/olat/course/assessment/ui/ChooseStartElementController.java index 1b233aeddddb5d503ae826972db89b2358de2e0f..a682c7e1f6a286021ca436845891d4c21b9fb679 100644 --- a/src/main/java/org/olat/course/assessment/ui/ChooseStartElementController.java +++ b/src/main/java/org/olat/course/assessment/ui/ChooseStartElementController.java @@ -67,6 +67,7 @@ public class ChooseStartElementController extends FormBasicController { treeModel = course.getEditorTreeModel(); selectTree = uifactory.addTreeMultiselect("elements", null, formLayout, treeModel, this); selectTree.setSelectedKeys(Collections.singletonList(preSelectedKey)); + selectTree.setNoDirtyCheckOnClick(true); uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl()); uifactory.addFormSubmitButton("ok", formLayout);