From 1e08fd73502c208816b9e0cf364e2092d9341ebf Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 4 Jan 2019 14:36:51 +0100 Subject: [PATCH] Fixed issue #2419 - Zammad Icon (Bird) on page top left disappears and does not come back. --- .../javascripts/app/controllers/navigation.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/navigation.coffee b/app/assets/javascripts/app/controllers/navigation.coffee index 033039d0b..6f11e4507 100644 --- a/app/assets/javascripts/app/controllers/navigation.coffee +++ b/app/assets/javascripts/app/controllers/navigation.coffee @@ -16,6 +16,7 @@ class App.Navigation extends App.ControllerWidgetPermanent 'submit form.search-holder': 'preventDefault' 'dblclick form.search-holder .icon-magnifier': 'openExtendedSearch' 'focus #global-search': 'searchFocus' + 'blur #global-search': 'searchBlur' 'keyup #global-search': 'listNavigate' 'click .js-global-search-result': 'emptyAndCloseDelayed' 'click .js-details-link': 'openExtendedSearch' @@ -207,6 +208,14 @@ class App.Navigation extends App.ControllerWidgetPermanent @searchContainer.addClass('focused') @selectAll(e) + searchBlur: (e) => + + # delay to be able to "click/execute" x if query is '' + update = => + if @searchInput.val().trim() is '' + @emptyAndClose() + @delay(update, 100, 'removeFocused') + listNavigate: (e) => if e.keyCode is 27 # close on esc @emptyAndClose() @@ -285,7 +294,6 @@ class App.Navigation extends App.ControllerWidgetPermanent @searchContainer.removeClass('focused filled open no-match loading') @globalSearch.close() @delayedRemoveAnyPopover() - @searchInput.blur() search: => query = @searchInput.val().trim()