Skip to content

Commit

Permalink
Merge pull request #5461 from kjac/v8-fix-confirm-discard-esc-key
Browse files Browse the repository at this point in the history
V8: Disable the escape key in the "unsaved changes" dialog
  • Loading branch information
nul800sebastiaan authored May 19, 2019
2 parents 5dbc95a + 572dc11 commit 0ea4864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 0ea4864

Please sign in to comment.