Commit 8b2c6107 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug #1756153: Fix collapse configurable theme menu on Esc / mouse click"

parents 736c0e40 c7626e36
......@@ -288,4 +288,18 @@ jQuery(function($) {
$(".js-select2 select").select2({});
/*
* Close navigation when ESC is pressed or focus is moved from navigation menu
*/
$(document).on('click keyup', function(event) {
// keyESCAPE constant is used since jQuerty.ui is not loaded on all pages
var keyESCAPE = 27;
if (
(event.type=='click' && !$(event.target).closest('.navbar-toggle').length) ||
(event.type == 'keyup' && event.keyCode == keyESCAPE)
) {
$('.navbar-collapse.collapse.in').collapse('hide');
}
});
});
Markdown is supported
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