Commit 89eb1401 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1903933: Change the condition for collapsing from on blur to on keyup"

parents 80288da1 4b75fcb7
......@@ -1206,11 +1206,12 @@ jQuery(function($) {
});
});
// Returns focus back to the menu button when the menu is closed
$('nav .navbar-collapse').on('hide.bs.collapse', function(e) {
if (!$(e.target).hasClass('child-nav collapse show')) {
var id = $(this).attr('id');
$('button[aria-controls=' + id + ']').focus();
// Return focus to the menu button on pressing esc on nav
$('nav .navbar-collapse').on('keyup', function(e) {
if (e.keyCode == 27) {
var parent = $(this);
var id = $(parent).attr('id');
$('button[aria-controls="' + id + '"]').focus();
}
});
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment