mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
fix: ng2-alfresco-search
This commit is contained in:
@@ -124,10 +124,25 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
|
||||
getMimeTypeIcon(node: any): string {
|
||||
if (node.entry.content && node.entry.content.mimeType) {
|
||||
let icon = this.alfrescoThumbnailService.getMimeTypeIcon(node.entry.content.mimeType);
|
||||
return require(`./../img/${icon}`);
|
||||
return this.resolveIconPath(icon);
|
||||
}
|
||||
}
|
||||
|
||||
resolveIconPath(icon: string): string {
|
||||
let result = null;
|
||||
try {
|
||||
// webpack
|
||||
result = require(`./../img/${icon}`);
|
||||
} catch (e) {
|
||||
// system.js
|
||||
if (module && module.id) {
|
||||
let baseComponentPath = module.id.replace('/components/alfresco-search-autocomplete.component.js', '');
|
||||
result = `${baseComponentPath}/img/${icon}`;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
Reference in New Issue
Block a user