Skip to content

Commit

Permalink
Merge pull request #718 from sachajudd/pulls/1/menu-toggle
Browse files Browse the repository at this point in the history
FIX Add aria-expanded to help menu toggle for screenreader accessibility
  • Loading branch information
maxime-rainville committed Oct 30, 2018
2 parents 952f37a + 4b0e69a commit 742a306
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion client/src/legacy/LeftAndMain.Menu.js
Expand Up @@ -465,7 +465,10 @@ $.entwine('ss', function($){

$('.cms-help__menu').entwine({
onclick: function () {
$('.cms-help__toggle').toggleClass('cms-help__toggle--show');
var expandedState = (this.attr('aria-expanded') === 'true');

this.attr('aria-expanded', !expandedState);
$('.cms-help__toggle').toggleClass('cms-help__toggle--show')
}
});
});
@@ -1,5 +1,5 @@
<div class="cms-help__toggle">
<button class="cms-help__menu" type="button" title="<%t SilverStripe\Admin\LeftAndMain.HelpMenu "Help menu" %>" aria-label="<%t SilverStripe\Admin\LeftAndMain.HelpMenu "Help menu" %>">
<button class="cms-help__menu" type="button" title="<%t SilverStripe\Admin\LeftAndMain.HelpMenu "Help menu" %>" aria-label="<%t SilverStripe\Admin\LeftAndMain.HelpMenu "Help menu" %>" aria-expanded="false">
<span class="cms-help__logo font-icon-silverstripe"></span>
<span class="cms-help__toggle-title">
$ApplicationName
Expand Down

0 comments on commit 742a306

Please sign in to comment.