diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-11-23 10:51:06 +0000 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-11-23 10:51:06 +0000 |
| commit | 9a273dbe3401a5ef004131828aa5166cd407ef82 (patch) | |
| tree | 0c2b4f3f3780f86e84ebb30b5f7f61b01ae9fffe | |
| parent | 732c2d15d235ca112db4b1d15c888da52660a1d5 (diff) | |
| parent | be045553ea4115853847cfcb8a0a40f2a3d7c4a2 (diff) | |
| download | gitlab-ce-9a273dbe3401a5ef004131828aa5166cd407ef82.tar.gz | |
Merge branch 'issue-2831' into 'master'
Fix Assignee selector when 'Unassigned' #2831
Fixes #2831

See merge request !1860
| -rw-r--r-- | CHANGELOG | 1 | ||||
| -rw-r--r-- | app/assets/javascripts/users_select.js.coffee | 15 |
2 files changed, 11 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG index 75e5b7585f9..fc7b6e75b1d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.3.0 (unreleased) + - Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera) v 8.2.0 - Improved performance of finding projects and groups in various places 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 |
