summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-03 19:08:57 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-03 19:08:57 +0000
commitd5d19a9fae4d6b009ffea765b7ad1f099262ca24 (patch)
tree5a20e38d3aa75ca70a928fc00408ee165762b841 /app
parent93a21183a08d3d43a1662c562f1a9fd83a85d168 (diff)
parent3102454a566292d6435fcaae8d21c6c2d26c0341 (diff)
downloadgitlab-ce-d5d19a9fae4d6b009ffea765b7ad1f099262ca24.tar.gz
Merge branch 'user-select-unassigned' into 'master'
Don't show Unassigned in user select when searching. Fixes #2056. When a search term is present, the Unassigned item isn't rendered, so the highlighted item is the first search result and hitting Enter works as expected. See merge request !1620
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/project_users_select.js.coffee17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/assets/javascripts/project_users_select.js.coffee b/app/assets/javascripts/project_users_select.js.coffee
index 885f0d58a6a..e22c7c11f1c 100644
--- a/app/assets/javascripts/project_users_select.js.coffee
+++ b/app/assets/javascripts/project_users_select.js.coffee
@@ -11,14 +11,15 @@ class @ProjectUsersSelect
Api.projectUsers project_id, query.term, (users) ->
data = { results: users }
- nullUser = {
- name: 'Unassigned',
- avatar: null,
- username: 'none',
- id: -1
- }
-
- data.results.unshift(nullUser)
+ if query.term.length == 0
+ nullUser = {
+ name: 'Unassigned',
+ avatar: null,
+ username: 'none',
+ id: -1
+ }
+
+ data.results.unshift(nullUser)
query.callback(data)