Skip to content

Commit

Permalink
MDL-67863 theme_boost: change keyboard tab order
Browse files Browse the repository at this point in the history
Move navdrawer up in the dom for a more logical tab order
Hide navdrawer links for tab / screenreader when navdrawer is closed
  • Loading branch information
Bas Brands committed Feb 27, 2020
1 parent 7b37466 commit 324d931
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion theme/boost/amd/build/drawer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion theme/boost/amd/build/drawer.min.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions theme/boost/amd/src/drawer.js
Expand Up @@ -128,8 +128,9 @@ define(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub'],
// Close.
body.removeClass('drawer-open-' + side);
trigger.attr('aria-expanded', 'false');
drawer.attr('aria-hidden', 'true');
drawer.addClass('closed');
drawer.addClass('closed').delay(500).queue(function() {
$(this).attr('aria-hidden', 'true').dequeue();
});
if (!small) {
M.util.set_user_preference(preference, 'false');
}
Expand Down
4 changes: 4 additions & 0 deletions theme/boost/scss/moodle/drawer.scss
Expand Up @@ -24,6 +24,10 @@ $drawer-offscreen-gutter: 20px !default;
left: -($drawer-width + $drawer-offscreen-gutter);
}

#nav-drawer[aria-hidden=true] .list-group-item {
display: none;
}

/* Use a variable for the drawer background colors. */
$drawer-bg: darken($body-bg, 5%) !default;

Expand Down
3 changes: 3 additions & 0 deletions theme/boost/style/moodle.css
Expand Up @@ -13626,6 +13626,9 @@ span.editinstructions {
#nav-drawer.closed {
left: -305px; }

#nav-drawer[aria-hidden=true] .list-group-item {
display: none; }

/* Use a variable for the drawer background colors. */
[data-region="drawer"] {
position: fixed;
Expand Down
2 changes: 1 addition & 1 deletion theme/boost/templates/columns2.mustache
Expand Up @@ -58,6 +58,7 @@
{{{ output.standard_top_of_body_html }}}

{{> theme_boost/navbar }}
{{> theme_boost/nav-drawer }}

<div id="page" class="container-fluid d-print-block">
{{{ output.full_header }}}
Expand Down Expand Up @@ -89,7 +90,6 @@
</div>
</div>
{{{ output.standard_after_main_region_html }}}
{{> theme_boost/nav-drawer }}
{{> theme_boost/footer }}
</div>

Expand Down
3 changes: 3 additions & 0 deletions theme/classic/style/moodle.css
Expand Up @@ -13884,6 +13884,9 @@ span.editinstructions {
#nav-drawer.closed {
left: -305px; }

#nav-drawer[aria-hidden=true] .list-group-item {
display: none; }

/* Use a variable for the drawer background colors. */
[data-region="drawer"] {
position: fixed;
Expand Down
4 changes: 2 additions & 2 deletions user/tests/behat/view_participants.feature
Expand Up @@ -113,12 +113,12 @@ Feature: View course participants
And I am on "Course 1" course homepage
And I navigate to course participants
And I follow "Email address"
When I follow "2"
When I click on "2" "link" in the "//nav[@aria-label='Page']" "xpath_element"
Then I should not see "student0x@example.com"
And I should not see "student19x@example.com"
And I should see "teacher1x@example.com"
And I follow "Email address"
And I follow "2"
And I click on "2" "link" in the "//nav[@aria-label='Page']" "xpath_element"
And I should not see "teacher1x@example.com"
And I should not see "student19x@example.com"
And I should not see "student1x@example.com"
Expand Down

0 comments on commit 324d931

Please sign in to comment.