1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

[api] update search user api

This commit is contained in:
lian
2016-01-14 13:10:24 +08:00
parent 5f3c030a52
commit 0e43a099ff
7 changed files with 218 additions and 16 deletions

View File

@@ -564,7 +564,7 @@ define([
// for search. both name & email can be searched.
// use ' '(space) to separate name & email
"text": users[i].name + ' ' + users[i].email,
"avatar": users[i].avatar,
"avatar_url": users[i].avatar_url,
"name": users[i].name
});
}
@@ -577,8 +577,8 @@ define([
// format items shown in the drop-down menu
formatResult: function(item) {
if (item.avatar) {
return item.avatar + '<span class="text ellipsis">' + _this.HTMLescape(item.name) + '<br />' + _this.HTMLescape(item.id) + '</span>';
if (item.avatar_url) {
return '<img src="' + item.avatar_url + '" width="32" height="32" class="avatar"><span class="text ellipsis">' + _this.HTMLescape(item.name) + '<br />' + _this.HTMLescape(item.id) + '</span>';
} else {
return; // if no match, show nothing
}