summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/users_select.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/users_select.js')
-rw-r--r--app/assets/javascripts/users_select.js8
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);