Commit 43fec5f1 authored by Jaque's avatar Jaque Committed by Robert Lyon

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

behatnotneeded

Change-Id: I8b59c68e379085c8188068bc73eca1e9824e3c4f
(cherry picked from commit c7626e36)
parent 298c17d7
......@@ -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