uploads: show thumbnails in dropzone widget.

This commit is contained in:
evazion
2019-09-22 22:28:15 -05:00
parent 94d2bc72f2
commit bf3e9e1c76
3 changed files with 19 additions and 1 deletions

View File

@@ -150,10 +150,13 @@ Upload.initialize_dropzone = function() {
let dropzone = new Dropzone("#filedropzone", {
paramName: "upload[file]",
url: "/uploads/preprocess",
createImageThumbnails: false,
thumbnailHeight: 150,
thumbnailWidth: 150,
thumbnailMethod: "contain",
addRemoveLinks: false,
maxFiles: 1,
maxFilesize: Upload.MAX_FILE_SIZE,
maxThumbnailFilesize: Upload.MAX_FILE_SIZE,
timeout: 0,
acceptedFiles: "image/jpeg,image/png,image/gif,video/mp4,video/webm,.swf",
previewTemplate: $("#dropzone-preview-template").html(),

View File

@@ -10,6 +10,20 @@
cursor: pointer;
position: relative;
.dz-preview {
display: flex;
img[data-dz-thumbnail] {
padding: 1em;
}
.dz-details {
display: flex;
flex-direction: column;
align-self: center;
}
}
&.dz-started .dropzone-hint {
display: none;
}

View File

@@ -1,4 +1,5 @@
<div class="dz-preview dz-file-preview">
<img data-dz-thumbnail/>
<div class="dz-details">
<div class="dz-filename">
<span data-dz-name></span>