mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-12 06:06:05 +10:00
Prevent creating autocomplete dropdown is user is not logged in
This commit is contained in:
@@ -32,7 +32,8 @@ class @SearchAutocomplete
|
||||
|
||||
@saveOriginalState()
|
||||
|
||||
@createAutocomplete()
|
||||
# Only when user is logged in
|
||||
@createAutocomplete() if gon.current_user_id
|
||||
|
||||
@searchInput.addClass('disabled')
|
||||
|
||||
@@ -123,6 +124,9 @@ class @SearchAutocomplete
|
||||
@clearInput.on 'click', @onRemoveLocationClick
|
||||
|
||||
enableAutocomplete: ->
|
||||
# No need to enable anything if user is not logged in
|
||||
return if !gon.current_user_id
|
||||
|
||||
dropdownMenu = @dropdown.find('.dropdown-menu')
|
||||
_this = @
|
||||
@loadingSuggestions = false
|
||||
|
||||
Reference in New Issue
Block a user