From 1fe982fb167276ef0a0b38a427d9b67192350c78 Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Wed, 25 Sep 2013 10:00:15 -0400 Subject: [PATCH 1/3] fix a11y error in help modal --- lms/templates/help_modal.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html index 1d2a416f5f..e9a427de0e 100644 --- a/lms/templates/help_modal.html +++ b/lms/templates/help_modal.html @@ -61,7 +61,7 @@ discussion_link = get_discussion_link(course) if course else None % if not user.is_authenticated(): - + % endif From 9affd38d2b1acceb9b203ed4d44c40e5071cf58e Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Wed, 25 Sep 2013 15:19:47 -0400 Subject: [PATCH 2/3] fix focus management for help modal --- lms/templates/help_modal.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html index e9a427de0e..f4f1c4ea15 100644 --- a/lms/templates/help_modal.html +++ b/lms/templates/help_modal.html @@ -80,8 +80,8 @@ discussion_link = get_discussion_link(course) if course else None -
- +
+

${_('Thank You!')}

@@ -106,7 +106,7 @@ discussion_link = get_discussion_link(course) if course else None ).format( open_time=open_time, close_time=close_time, - link_start=''.format(marketing_link('FAQ')), + link_start=''.format(marketing_link('FAQ')), link_end='' )}

@@ -119,7 +119,8 @@ discussion_link = get_discussion_link(course) if course else None $(".help-modal .close-modal").off("click"); $("#lean_overlay").off("click"); $("#help-modal").attr("aria-hidden", "true"); - $(".help-tab").focus(); + $('area,input,select,textarea,button').removeAttr('tabindex'); + $(".help-tab a").focus(); }, cycle_modal_tab = function(from_element_name, to_element_name) { $(from_element_name).on('keydown', function(e) { @@ -156,7 +157,7 @@ discussion_link = get_discussion_link(course) if course else None }; cycle_modal_tab("#feedback_link_question", "#help_wrapper .close-modal"); cycle_modal_tab("#feedback_submit", "#feedback_form_wrapper .close-modal"); - cycle_modal_tab("#feedback_faq_link", "#feedback_success_wrapper .close-modal"); + cycle_modal_tab("#feedback-faq-link", "#feedback_success_wrapper .close-modal"); $("#help-modal").on("keydown", function(e) { var keyCode = e.keyCode || e.which; if (keyCode === 27) { @@ -194,6 +195,8 @@ discussion_link = get_discussion_link(course) if course else None }); $("#feedback_form").submit(function() { $("input[type='submit']", this).attr("disabled", "disabled"); + $('area,input,select,textarea,button').attr('tabindex', -1); + $("#feedback_form_wrapper .close-modal").focus(); }); $("#feedback_form").on("ajax:complete", function() { $("input[type='submit']", this).removeAttr("disabled"); From 6a412f4df681c232f381e13c782884337e0f02ce Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Wed, 25 Sep 2013 15:25:49 -0400 Subject: [PATCH 3/3] 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)