Do not show dropdown menu if when no suggestions returned
This commit is contained in:
parent
d681623c71
commit
07a0278d63
|
@ -79,6 +79,11 @@ class @SearchAutocomplete
|
||||||
project_ref: @projectRef
|
project_ref: @projectRef
|
||||||
term: term
|
term: term
|
||||||
}, (response) ->
|
}, (response) ->
|
||||||
|
# Hide dropdown menu if no suggestions returns
|
||||||
|
if !response.length
|
||||||
|
_this.disableAutocomplete()
|
||||||
|
return
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
|
|
||||||
# List results
|
# List results
|
||||||
|
@ -228,10 +233,6 @@ class @SearchAutocomplete
|
||||||
|
|
||||||
@dropdown.removeClass 'open'
|
@dropdown.removeClass 'open'
|
||||||
|
|
||||||
# Only add class if there's a badge
|
|
||||||
# if @badgePresent()
|
|
||||||
# @searchInput.addClass 'disabled'
|
|
||||||
|
|
||||||
badgePresent: ->
|
badgePresent: ->
|
||||||
@locationBadgeEl.children().length
|
@locationBadgeEl.children().length
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue