From 793622b44ccc566f1477f7e24dda1b04702de23c Mon Sep 17 00:00:00 2001 From: Jareer Ahsan Date: Wed, 24 Aug 2016 17:20:22 +0500 Subject: [PATCH] Fixed Shift-Tab on menu and ARIA roles, groups ECOM-4945 --- lms/static/js/my_courses_dropdown.js | 11 +++----- lms/templates/user_dropdown.html | 38 +++++++++++++++------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/lms/static/js/my_courses_dropdown.js b/lms/static/js/my_courses_dropdown.js index 88d6861f5f..fe2a9f9ff1 100644 --- a/lms/static/js/my_courses_dropdown.js +++ b/lms/static/js/my_courses_dropdown.js @@ -54,9 +54,9 @@ $(document).ready(function() { event.preventDefault(); } - // if up arrow key pressed or shift+tab + // if up arrow key pressed or shift+tab else down key or tab is pressed if (event.which == 38 || (event.which == 9 && event.shiftKey)) { - // if first item go to last + // if first item go to last if (focusedItemIndex === 0) { menuItems.last().focus(); } else { @@ -64,11 +64,8 @@ $(document).ready(function() { menuItems.get(itemToFocusIndex).focus(); } event.preventDefault(); - } - - // if down arrow key pressed or tab key - if (event.which == 40 || event.which == 9) { - // if last item go to first + } else if (event.which == 40 || event.which == 9) { + // if last item go to first if (focusedItemIndex == numberOfMenuItems - 1) { menuItems.first().focus(); } else { diff --git a/lms/templates/user_dropdown.html b/lms/templates/user_dropdown.html index 1c272a812b..b46698957a 100644 --- a/lms/templates/user_dropdown.html +++ b/lms/templates/user_dropdown.html @@ -20,18 +20,20 @@ from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_ ${username} - - +
+ + +
% else:
    @@ -47,11 +49,13 @@ from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_
  1. - - +
    + + +
% endif