-
-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XWIKI-18007: Drawer menu improvements for accessibility #2075
Conversation
...amingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm
Outdated
Show resolved
Hide resolved
...amingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm
Outdated
Show resolved
Hide resolved
...amingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/javascript.vm
Outdated
Show resolved
Hide resolved
// Drawer can be closed by pressing the ESC key, regardless of how it was opened, whether by keyboard or clicking. | ||
$(document).on('keydown', function (event) { | ||
if (event.key === 'Escape') { | ||
$('.drawer-nav') | ||
.closest('body') | ||
.drawer('close'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should limit javascript.vm
for JavaScript code that needs to be executed very early. The rest of the JavaScript code should be put in dedicated JavaScript files. In this case I'd move the entire RequireJS block that handles the drawer to flamingo.js
.
Moved the code responsible for drawer to the flamingo.js file Fixed formatting
db4383f
to
0e06788
Compare
This PR doesn't fix the mentioned Jira issue but only a small part of it. Missing parts from what I can see are:
It is fine to just fix closing the drawer, but I think for this, a new Jira issue should be created that can be closed after this has been merged while the original issue should stay open until everything has been fixed. |
Closing as the work as been done in #2225 |
This PR partly fix the issue https://jira.xwiki.org/browse/XWIKI-18007
The drawer menu can now be closed by pressing the
ESC
key (this works for both the cases, 1) if you opened the drawer using keyboard 2) if you opened the drawer by clicking on it)Earlier there was no such option to close the drawer menu through keyboard.