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

[folder perm, share] select contacts: enable search contact name

This commit is contained in:
llj
2015-04-30 21:19:35 +08:00
parent 3934bb18ab
commit 70315404b3
3 changed files with 10 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ define([
for (var i = 0, len = contacts.length; i < len; i++) {
contact_list.push({ // 'id' & 'text' are required by the plugin
"id": contacts[i].email,
"text": contacts[i].email,
"text": contacts[i].name + contacts[i].email, // for search. both name & email can be searched.
"avatar": contacts[i].avatar,
"name": contacts[i].name
});
@@ -107,13 +107,13 @@ define([
tokenSeparators: [',', ' '],
formatResult: function(item) { // format items shown in the drop-down menu
if (item.avatar) {
return item.avatar + '<span class="text">' + item.name + '<br />' + item.text + '</span>';
return item.avatar + '<span class="text">' + item.name + '<br />' + item.id + '</span>';
} else {
return; // if no match, show nothing
}
},
formatSelection: function(item) { // format selected item shown in the input
return item.name || item.text; // if no name, show the email, i.e., when directly input, show the email
return item.name || item.id; // if no name, show the email, i.e., when directly input, show the email
},
escapeMarkup: function(m) { return m; }
});

View File

@@ -420,7 +420,7 @@ define([
for (var i = 0, len = contacts.length; i < len; i++) {
contact_list.push({ // 'id' & 'text' are required by the plugin
"id": contacts[i].email,
"text": contacts[i].email,
"text": contacts[i].name + contacts[i].email, // for search. both name & email can be searched.
"avatar": contacts[i].avatar,
"name": contacts[i].name
});
@@ -429,13 +429,13 @@ define([
},
formatResult: function(item) { // format items shown in the drop-down menu
if (item.avatar) {
return item.avatar + '<span class="text">' + item.name + '<br />' + item.text + '</span>';
return item.avatar + '<span class="text">' + item.name + '<br />' + item.id + '</span>';
} else {
return; // if no match, show nothing
}
},
formatSelection: function(item) { // format selected item shown in the input
return item.name || item.text; // if no name, show the email, i.e., when directly input, show the email
return item.name || item.id; // if no name, show the email, i.e., when directly input, show the email
},
tokenSeparators: [',', ' '],
escapeMarkup: function(m) { return m; }
@@ -499,7 +499,7 @@ define([
for (var i = 0, len = contacts.length; i < len; i++) {
contact_list.push({ // 'id' & 'text' are required by the plugin
"id": contacts[i].email,
"text": contacts[i].email,
"text": contacts[i].name + contacts[i].email, // for search. both name & email can be searched.
"avatar": contacts[i].avatar,
"name": contacts[i].name
});
@@ -508,13 +508,13 @@ define([
},
formatResult: function(item) { // format items shown in the drop-down menu
if (item.avatar) {
return item.avatar + '<span class="text">' + item.name + '<br />' + item.text + '</span>';
return item.avatar + '<span class="text">' + item.name + '<br />' + item.id + '</span>';
} else {
return; // if no match, show nothing
}
},
formatSelection: function(item) { // format selected item shown in the input
return item.name || item.text; // if no name, show the email, i.e., when directly input, show the email
return item.name || item.id; // if no name, show the email, i.e., when directly input, show the email
},
tokenSeparators: [',', ' '],
escapeMarkup: function(m) { return m; }