summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-16 11:05:14 +0100
committerPhil Hughes <me@iamphill.com>2016-06-20 11:55:59 +0100
commit77c8600a39fb357198459b1dc47e23a994ed4211 (patch)
tree028cd0bddc96b817217a728c82f77008ae8ef230
parent44b8b77e02423ce97f9abe80e0335f4f4c453c83 (diff)
downloadgitlab-ce-77c8600a39fb357198459b1dc47e23a994ed4211.tar.gz
Fixed search field blur not removing focus
Closes #18670
-rw-r--r--app/assets/javascripts/search_autocomplete.js.coffee9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/assets/javascripts/search_autocomplete.js.coffee b/app/assets/javascripts/search_autocomplete.js.coffee
index 421328554b8..3c33d87b696 100644
--- a/app/assets/javascripts/search_autocomplete.js.coffee
+++ b/app/assets/javascripts/search_autocomplete.js.coffee
@@ -171,22 +171,15 @@ class @SearchAutocomplete
}
bindEvents: ->
- $(document).on 'click', @onDocumentClick
@searchInput.on 'keydown', @onSearchInputKeyDown
@searchInput.on 'keyup', @onSearchInputKeyUp
@searchInput.on 'click', @onSearchInputClick
@searchInput.on 'focus', @onSearchInputFocus
+ @searchInput.on 'blur', @onSearchInputBlur
@clearInput.on 'click', @onClearInputClick
@locationBadgeEl.on 'click', =>
@searchInput.focus()
- onDocumentClick: (e) =>
- # If clicking outside the search box
- # And search input is not focused
- # And we are not clicking inside a suggestion
- if not $.contains(@dropdown[0], e.target) and @isFocused and not $(e.target).closest('.search-form').length
- @onSearchInputBlur()
-
enableAutocomplete: ->
# No need to enable anything if user is not logged in
return if !gon.current_user_id