Do not show dropdown menu if when no suggestions returned

This commit is contained in:
Alfredo Sumaran 2016-03-27 13:28:45 -05:00
parent d681623c71
commit 07a0278d63
1 changed files with 5 additions and 4 deletions

View File

@ -79,6 +79,11 @@ class @SearchAutocomplete
project_ref: @projectRef
term: term
}, (response) ->
# Hide dropdown menu if no suggestions returns
if !response.length
_this.disableAutocomplete()
return
data = []
# List results
@ -228,10 +233,6 @@ class @SearchAutocomplete
@dropdown.removeClass 'open'
# Only add class if there's a badge
# if @badgePresent()
# @searchInput.addClass 'disabled'
badgePresent: ->
@locationBadgeEl.children().length