mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-10 21:24:33 +01:00
customize search results
This commit is contained in:
parent
d4fbd5ffa7
commit
b1df56c875
17
js/loader.js
17
js/loader.js
@ -129,6 +129,23 @@ OC.ContactsImporter = OC.ContactsImporter || {
|
|||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
// translate search result type
|
||||||
|
OC.search.resultTypes.contact = t('contacts', 'Contact');
|
||||||
|
|
||||||
|
OC.search.customResults.contact = function (row, item){
|
||||||
|
var text = '';
|
||||||
|
if (item.email) {
|
||||||
|
text += '✉ ' + item.email;
|
||||||
|
if (item.phone) {
|
||||||
|
text += ', '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.phone) {
|
||||||
|
text += '☎ ' + item.phone
|
||||||
|
}
|
||||||
|
row.find('td.result .text').text(text);
|
||||||
|
};
|
||||||
|
|
||||||
// If the app is already active there's no need for the FileActions
|
// If the app is already active there's no need for the FileActions
|
||||||
if(OC.Contacts) {
|
if(OC.Contacts) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user