Prevent the page from reloading when an alert modal is open but not focused and the user hits enter

This commit is contained in:
Michael Abashian 2016-07-22 09:55:14 -04:00
parent 6fa95322f5
commit fde13c6a46

View File

@ -134,6 +134,7 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
});
$(document).bind('keydown', function (e) {
if (e.keyCode === 27 || e.keyCode === 13) {
e.preventDefault();
$('#alert-modal2').modal('hide');
}
});
@ -161,6 +162,7 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
});
$(document).bind('keydown', function (e) {
if (e.keyCode === 27 || e.keyCode === 13) {
e.preventDefault();
$('#alert-modal').modal('hide');
}
});