Merge pull request #5461 from kjac/v8-fix-confirm-discard-esc-key

V8: Disable the escape key in the "unsaved changes" dialog
This commit is contained in:
Sebastiaan Janssen
2019-05-19 10:01:14 +02:00
committed by GitHub
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() {