From fde13c6a46bbdf67be3c43460722dc2f303d6535 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 22 Jul 2016 09:55:14 -0400 Subject: [PATCH] Prevent the page from reloading when an alert modal is open but not focused and the user hits enter --- awx/ui/client/src/shared/Utilities.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/ui/client/src/shared/Utilities.js b/awx/ui/client/src/shared/Utilities.js index f7ccaf0be4..bdb7ddf03c 100644 --- a/awx/ui/client/src/shared/Utilities.js +++ b/awx/ui/client/src/shared/Utilities.js @@ -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'); } });