mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fix filename shown in title area of viewer component
This commit is contained in:
@@ -34,6 +34,9 @@ export class ViewerComponent {
|
||||
@Input()
|
||||
urlFile: string;
|
||||
|
||||
@Input()
|
||||
fileName: string = null;
|
||||
|
||||
@Input()
|
||||
mimeType: string = null;
|
||||
|
||||
@@ -48,7 +51,7 @@ export class ViewerComponent {
|
||||
|
||||
otherMenu: any;
|
||||
|
||||
nameFile: string;
|
||||
displayName: string;
|
||||
currentPdfDocument: any;
|
||||
page: number;
|
||||
displayPage: number;
|
||||
@@ -64,8 +67,9 @@ export class ViewerComponent {
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
if (this.urlFile) {
|
||||
this.nameFile = this.getFilenameFromUrl(this.urlFile);
|
||||
this.extension = this.getFileExtension(this.nameFile);
|
||||
let filenameFromUrl = this.getFilenameFromUrl(this.urlFile);
|
||||
this.displayName = this.fileName !== null ? this.fileName : filenameFromUrl;
|
||||
this.extension = this.getFileExtension(filenameFromUrl);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
|
Reference in New Issue
Block a user