Add alt text for mimetype icons in search component

Refs #302
This commit is contained in:
Will Abson
2016-06-29 16:44:58 +01:00
parent 1334f52e20
commit f92539db19
6 changed files with 78 additions and 35 deletions

View File

@@ -95,6 +95,19 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
}
}
/**
* Gets thumbnail message key for the given document node, which can be used to look up alt text
* @param node Node to get URL for.
* @returns {string} URL address.
*/
getMimeTypeKey(node: any): string {
if (node.entry.content && node.entry.content.mimeType) {
return 'SEARCH.ICONS.' + this._alfrescoThumbnailService.getMimeTypeKey(node.entry.content.mimeType);
} else {
return '';
}
}
/**
* Loads and displays search results
* @param searchTerm Search query entered by user