diff --git a/www/js/lib/uiUtil.js b/www/js/lib/uiUtil.js index 8258406a..6e58c00f 100644 --- a/www/js/lib/uiUtil.js +++ b/www/js/lib/uiUtil.js @@ -656,6 +656,18 @@ define(rqDef, function(util) { resolve(false); } }); + document.getElementById('alertModal').addEventListener('keyup', function (e) { + if (/Enter/.test(e.key)) { + // We need to focus before clicking the button, because the handler above is based on document.activeElement + if (isConfirm) { + document.getElementById('approveConfirm').focus(); + document.getElementById('approveConfirm').click(); + } else { + document.getElementById('closeMessage').focus(); + document.getElementById('closeMessage').click(); + } + } + }); }); }