From 0dc52bf1c9039288b9cfaa1fef944f286a6f34aa Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 18 Apr 2018 13:33:08 +0200 Subject: [PATCH] Add proper ARIA attributes and structure to header for accessibility, thanks to @MarcoZehe Signed-off-by: Jan-Christoph Borchardt --- core/js/js.js | 8 ++++++++ core/templates/layout.user.php | 31 ++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 872761c02bbe2..7fc911a302cea 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -677,6 +677,10 @@ var OCP = {}, // close it self.hideMenus(); } + + // Set menu to expanded + $toggle.attr('aria-expanded', true); + $menuEl.slideToggle(OC.menuSpeed, toggle); OC._currentMenu = $menuEl; OC._currentMenuToggle = $toggle; @@ -711,6 +715,10 @@ var OCP = {}, } }); } + + // Set menu to closed + $('.menutoggle').attr('aria-expanded', false); + OC._currentMenu = null; OC._currentMenuToggle = null; }, diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 32762e2c240fc..86e9f50f43cc9 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -45,8 +45,9 @@ -
  • class="active"> - + class="active" + aria-label=""> + @@ -103,11 +106,17 @@ t('Reset search'));?>
    - - + +
    -