[ADF-662] fix readonly button for upload and added event for show file in viewer (#2215)

This commit is contained in:
Vito
2017-08-14 14:15:29 -07:00
committed by Mario Romano
parent 4e4c22389c
commit c3ad16bea7
4 changed files with 50 additions and 2 deletions

View File

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