From 6a412f4df681c232f381e13c782884337e0f02ce Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Wed, 25 Sep 2013 15:25:49 -0400 Subject: [PATCH] add ESC key functionality to forgot password modal --- lms/templates/forgot_password_modal.html | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)