1
0
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:
Jörn Friedrich Dreyer 2014-10-01 18:08:24 +02:00
parent d4fbd5ffa7
commit b1df56c875

View File

@ -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;