diff --git a/client/src/views/fields/attachment-multiple.js b/client/src/views/fields/attachment-multiple.js index 94e0623dc3..7579742363 100644 --- a/client/src/views/fields/attachment-multiple.js +++ b/client/src/views/fields/attachment-multiple.js @@ -343,7 +343,7 @@ function (Dep, FileUpload) { getEditPreview: function (name, type, id) { if (!~this.previewTypeList.indexOf(type)) { - return name; + return null; } return $('') @@ -368,11 +368,9 @@ function (Dep, FileUpload) { if (this.showPreviews) { let html = this.getEditPreview(name, type, id); - if (!html) { - return $text.get(0).outerHTML; + if (html) { + return html; } - - return html; } let url = this.getBasePath() + '?entryPoint=download&id=' + id; diff --git a/client/src/views/fields/file.js b/client/src/views/fields/file.js index eba27e9a2d..7660404220 100644 --- a/client/src/views/fields/file.js +++ b/client/src/views/fields/file.js @@ -627,11 +627,9 @@ define('views/fields/file', ['views/fields/link', 'helpers/file-upload'], functi if (this.showPreview) { let html = this.getEditPreview(name, type, id); - if (!html) { - return $text.get(0).outerHTML; + if (html) { + return html; } - - return html; } let url = this.getBasePath() + '?entryPoint=download&id=' + id;