diff options
author | Jared Deckard <jared.deckard@gmail.com> | 2016-07-26 22:32:10 -0500 |
---|---|---|
committer | Jared Deckard <jared.deckard@gmail.com> | 2016-09-08 12:23:12 -0500 |
commit | 7f6474b269a5cfa454d28c0c0da969490c9eb33e (patch) | |
tree | aafe7df9bc2683712a466595a046adb57e222565 /app/assets/javascripts/users_select.js | |
parent | 4c833a1d4ead49c27f6a81e607d10a5c6f0fcc2b (diff) | |
download | gitlab-ce-7f6474b269a5cfa454d28c0c0da969490c9eb33e.tar.gz |
Restore comments lost when converting CoffeeScript to JavaScript
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); |