bug fixes for thumbnails and Safari download (#1763)

- set ‘show thumbnail’ to true by default
- add support for safe downloads in Safari (upcoming 10.1 and TP)
This commit is contained in:
Denys Vuika
2017-03-24 13:27:51 +00:00
committed by Maurizio Vitale
parent fab8866d0c
commit cf67a0c1b5
3 changed files with 8 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ export class ActivitiContent implements OnChanges {
id: string;
@Input()
showDocumentContent: boolean = false;
showDocumentContent: boolean = true;
@Output()
contentClick = new EventEmitter();

View File

@@ -48,7 +48,7 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
// upload/attach
hasFile: boolean = false;
showDocumentContent: boolean = false;
showDocumentContent: boolean = true;
constructor(private formService: FormService,
private visibilityService: WidgetVisibilityService,
@@ -61,7 +61,9 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
this.value = this.field.value;
this.visibilityService.refreshEntityVisibility(this.field);
if (this.field.params) {
this.showDocumentContent = !!this.field.params['showDocumentContent'];
if (this.field.params['showDocumentContent'] !== undefined) {
this.showDocumentContent = !!this.field.params['showDocumentContent'];
}
let originalField = this.field.params['field'];
if (originalField && originalField.type) {
this.fieldType = originalField.type;

View File

@@ -32,17 +32,13 @@ export class ContentService {
return function (data, format, fileName) {
let blob = null;
if (format === 'blob') {
blob = data;
}
if (format === 'data') {
blob = new Blob([data], {type: 'octet/stream'});
if (format === 'blob' || format === 'data') {
blob = new Blob([data], { type: 'octet/stream' });
}
if (format === 'object' || format === 'json') {
let json = JSON.stringify(data);
blob = new Blob([json], {type: 'octet/stream'});
blob = new Blob([json], { type: 'octet/stream' });
}
if (blob) {