diff --git a/lms/templates/forgot_password_modal.html b/lms/templates/forgot_password_modal.html index a23df08cfc..411b863e00 100644 --- a/lms/templates/forgot_password_modal.html +++ b/lms/templates/forgot_password_modal.html @@ -75,5 +75,15 @@ cycle_modal_tab("#pwd_reset_email", "#pwd_reset_button") cycle_modal_tab("#pwd_reset_button", "#forgot-password-modal .close-modal") + // Hitting the ESC key will exit the modal + $("#forgot-password-modal").on("keydown", function(e) { + var keyCode = e.keyCode || e.which; + // 27 is the ESC key + if (keyCode === 27) { + e.preventDefault(); + $("#forgot-password-modal .close-modal").click(); + } + }); + })(this)