diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2019-05-17 15:10:50 +0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2019-05-18 13:34:26 +0200 |
commit | 301ae74e8bab8cded3592588021090ff75f2bf21 (patch) | |
tree | d6ed692b02ad076c7cac69e5a5cfa7f56eb7bdd2 /help3xsl/help2.js | |
parent | 1368e08b24cd3f13ef3de72475f6fbc70b56baa0 (diff) |
Improve accessibility for modules and lang menus
Ever since the contents of the modules and lang menus started
being populated upon click, the flow for screenreader users has
been potentially confusing.
This patch introduces a11y-toggle into the mix:
https://github.com/edenspiekermann/a11y-toggle
Checkboxes were changed into buttons. This hopefully makes it
clear we want the user to click them.
The contents tree still uses the checkbox hack, because its items
are populated upon page load.
Change-Id: I3482bea0c8669f96794498fc37d9d18fe3f829d5
Reviewed-on: https://gerrit.libreoffice.org/72467
Tested-by: Jenkins
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help2.js')
-rw-r--r-- | help3xsl/help2.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/help3xsl/help2.js b/help3xsl/help2.js index f62105dc62..54dd195ab3 100644 --- a/help3xsl/help2.js +++ b/help3xsl/help2.js @@ -217,10 +217,16 @@ debugInfo(getParameterByName("Debug")); // Mobile devices need the modules and langs on page load if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 960) { - var e = new Event('change'); - var modules = document.getElementById('modules'); - var langs = document.getElementById('langs'); - modules.dispatchEvent(e); - langs.dispatchEvent(e); + var e = new Event('click'); + var modulesBtn = document.getElementById('modules'); + var langsBtn = document.getElementById('langs'); + var modules = document.getElementById('modules-nav'); + var langs = document.getElementById('langs-nav'); + modules.setAttribute('data-a11y-toggle-open', ''); + modulesBtn.dispatchEvent(e); + if (langs) { + langs.setAttribute('data-a11y-toggle-open', ''); + langsBtn.dispatchEvent(e); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |