make sidebar headers toggable via keyboard

This commit is contained in:
Andreas Gohr 2017-02-22 11:48:17 +01:00
commit bed1717f37

View file

@ -77,6 +77,7 @@ jQuery(function () {
const $toggler = jQuery('<h6>') const $toggler = jQuery('<h6>')
.attr('role', 'heading') .attr('role', 'heading')
.attr('aria-level', '2') .attr('aria-level', '2')
.attr('tabindex', '0')
.text(text) .text(text)
.wrapInner('<span class="lbl">') .wrapInner('<span class="lbl">')
.prepend($icon) .prepend($icon)
@ -102,7 +103,7 @@ jQuery(function () {
* Initialize the open/close toggling of menu entries * Initialize the open/close toggling of menu entries
*/ */
const initMenuHandling = function () { const initMenuHandling = function () {
$nav.on('click', 'h6', function () { $nav.on('click keypress', 'h6', function () {
toggleNav(jQuery(this)); toggleNav(jQuery(this));
}); });
}; };