mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-662] fix readonly button for upload and added event for show file in viewer (#2215)
This commit is contained in:
@@ -21,6 +21,7 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { LogService, ThumbnailService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ContentLinkModel } from '../core/content-link.model';
|
||||
import { baseHost, WidgetComponent } from './../widget.component';
|
||||
|
||||
@Component({
|
||||
@@ -117,4 +118,16 @@ export class UploadWidgetComponent extends WidgetComponent implements OnInit {
|
||||
return this.thumbnailService.getMimeTypeIcon(mimeType);
|
||||
}
|
||||
|
||||
fileClicked(file: ContentLinkModel): void {
|
||||
this.formService.getFileRawContent(file.id).subscribe(
|
||||
(blob: Blob) => {
|
||||
file.contentBlob = blob;
|
||||
this.formService.formContentClicked.next(file);
|
||||
},
|
||||
(error) => {
|
||||
this.logService.error('Unable to send evento for file ' + file.name);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user