diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-09-09 13:37:17 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-09-09 13:37:17 +0000 |
commit | 2b3a1da6f3ceb4c78c055f14dfe93dbe818366d3 (patch) | |
tree | b6c585da17148c565687bd71ff55f89d41d8044a /app/assets/javascripts/users_select.js | |
parent | 4bdcbc85987a03f21bc326905b581239f74f8b04 (diff) | |
parent | 913857e57765f6911f171fb2fcd12532d6b6f1df (diff) | |
download | gitlab-ce-2b3a1da6f3ceb4c78c055f14dfe93dbe818366d3.tar.gz |
Merge branch '20300-restore-comments' into 'master'
Restore comments lost when converting CoffeeScript to JavaScript
## What does this MR do?
Restores comments lost in the great fire of !5464.
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
#20300
## What are the relevant issue numbers?
- #20300 (comments)
- #20098 (ES6)
## Does this MR meet the acceptance criteria?
- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
Closes #20300
See merge request !5541
Diffstat (limited to 'app/assets/javascripts/users_select.js')
-rw-r--r-- | app/assets/javascripts/users_select.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js index bad82868ab0..9c277998db4 100644 --- a/app/assets/javascripts/users_select.js +++ b/app/assets/javascripts/users_select.js @@ -81,6 +81,7 @@ if (term.length === 0) { showDivider = 0; if (firstUser) { + // Move current user to the front of the list for (index = j = 0, len = users.length; j < len; index = ++j) { obj = users[index]; if (obj.username === firstUser) { @@ -115,6 +116,7 @@ if (showDivider) { users.splice(showDivider, 0, "divider"); } + // Send the data back return callback(users); }); }, @@ -139,6 +141,7 @@ inputId: 'issue_assignee_id', hidden: function(e) { $selectbox.hide(); + // display:block overrides the hide-collapse rule return $value.css('display', ''); }, clicked: function(user, $el, e) { @@ -177,6 +180,7 @@ img = "<img src='" + avatar + "' class='avatar avatar-inline' width='30' />"; } } + // split into three parts so we can remove the username section if nessesary listWithName = "<li> <a href='#' class='dropdown-menu-user-link " + selected + "'> " + img + " <strong class='dropdown-menu-user-full-name'> " + user.name + " </strong>"; listWithUserName = "<span class='dropdown-menu-user-username'> " + username + " </span>"; listClosingTags = "</a> </li>"; @@ -215,6 +219,7 @@ }; if (query.term.length === 0) { if (firstUser) { + // Move current user to the front of the list ref = data.results; for (index = j = 0, len = ref.length; j < len; index = ++j) { obj = ref[index]; @@ -271,6 +276,7 @@ return _this.formatSelection.apply(_this, args); }, dropdownCssClass: "ajax-users-dropdown", + // we do not want to escape markup since we are displaying html in results escapeMarkup: function(m) { return m; } @@ -318,6 +324,8 @@ }); }; + // Return users list. Filtered by query + // Only active users retrieved UsersSelect.prototype.users = function(query, options, callback) { var url; url = this.buildUrl(this.usersPath); |