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; id: string;
@Input() @Input()
showDocumentContent: boolean = false; showDocumentContent: boolean = true;
@Output() @Output()
contentClick = new EventEmitter(); contentClick = new EventEmitter();

View File

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

View File

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