summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJose Corcuera <jzcorcuera@gmail.com>2015-11-20 23:55:17 -0500
committerJose Corcuera <jzcorcuera@gmail.com>2015-11-20 23:55:17 -0500
commitbe045553ea4115853847cfcb8a0a40f2a3d7c4a2 (patch)
tree3f5e863a4301c01995e4e316ebf6f8f12847015b /app
parent94b90db5479a4536d459d8e6beaeaea376f6b356 (diff)
downloadgitlab-ce-be045553ea4115853847cfcb8a0a40f2a3d7c4a2.tar.gz
Fix Assignee selector when 'Unassigned' #2831
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/users_select.js.coffee15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee
index 9157562a5c5..f5db74d84e7 100644
--- a/app/assets/javascripts/users_select.js.coffee
+++ b/app/assets/javascripts/users_select.js.coffee
@@ -58,11 +58,8 @@ class @UsersSelect
query.callback(data)
- initSelection: (element, callback) =>
- id = $(element).val()
- if id != "" && id != "0"
- @user(id, callback)
-
+ initSelection: (args...) =>
+ @initSelection(args...)
formatResult: (args...) =>
@formatResult(args...)
formatSelection: (args...) =>
@@ -71,6 +68,14 @@ class @UsersSelect
escapeMarkup: (m) -> # we do not want to escape markup since we are displaying html in results
m
+ initSelection: (element, callback) ->
+ id = $(element).val()
+ if id == "0"
+ nullUser = { name: 'Unassigned' }
+ callback(nullUser)
+ else if id != ""
+ @user(id, callback)
+
formatResult: (user) ->
if user.avatar_url
avatar = user.avatar_url