Disable the escape key in the "confirm discard" dialog

This commit is contained in:
Kenn Jacobsen
2019-05-14 18:43:57 +02:00
parent a43359e440
commit 572dc11995
2 changed files with 3 additions and 2 deletions

View File

@@ -286,11 +286,11 @@ Opens an overlay to show a custom YSOD. </br>
$(document).on("keydown.overlay-" + overlayNumber, function(event) {
if (event.which === 27) {
if (event.which === 27) {
numberOfOverlays = overlayHelper.getNumberOfOverlays();
if (numberOfOverlays === overlayNumber) {
if (numberOfOverlays === overlayNumber && !scope.model.disableEscKey) {
scope.$apply(function () {
scope.closeOverLay();
});

View File

@@ -165,6 +165,7 @@ function valFormManager(serverValidationManager, $rootScope, $timeout, $location
"title": labels.unsavedChangesTitle,
"content": labels.unsavedChangesContent,
"disableBackdropClick": true,
"disableEscKey": true,
"submitButtonLabel": labels.stayButton,
"closeButtonLabel": labels.discardChangesButton,
submit: function() {