From aab32214d6bdb46e30d570f8a57955fae22c88b8 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Thu, 21 Sep 2017 17:52:51 +0200 Subject: [PATCH] JS: Close menu correctly after searching on iOS fixes #2922 --- public/js/icinga/ui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 7aff970f8..4135f1516 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -533,8 +533,10 @@ * @param {object} e Event */ closeMobileMenu: function(e) { - if (e.which === 13) { + var $search = $('#search'); + if (e.which === 13 && $search.is(':focus')) { $('#sidebar').removeClass('expanded'); + $search.blur(); } }, @@ -601,7 +603,7 @@ .prepend( $('
') ); - $search.on('keypress', this.closeMobileMenu); + $(window).on('keypress', this.closeMobileMenu); this.mobileMenu = true; }