New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload without preview #175
Comments
You can just set the option You can't just set an empty Just hide the preview square with CSS if you also don't like the square with the filename (as @kennwags suggested). Cheers |
@kennwags: performance problems.. why should I make DOM manipulations and then hide it... it's a hack ;) |
Would be good to add this to the site's API documentation. |
I love this plugin so far, but I would also +1 for upload without preview. |
previewTemplate : this works, but it would be desirable to tell false variable and worked |
faeb187, the reason it doesnt work with an empty template is cause it waits for a DOM html object, so an empty string doesnt fit. U need an html node, so u can create a span, it doesnt display any width/height if it has no content inside (and if it has the span default css properties, ofcourse) |
@vieiradev yeah obv mate.. just tried to explain my issue.. I'm using jquery.filedrop atm... just for the other guys who try with display:none.. that's no solution.. we're lightweight.. we're performance oriented.. If a developer starts to accept unproper things happening in his code (e.g. DOM access without using it).... that's just against modern innovative web development and poor =) maybe I'm a nerd. |
Simply in your dropzone configuration provide an 'addedfile' option and leave it empty.
This will upload the file but do nothing afterwards. |
You can now accomplish this by setting the previewsContainer option to false which was introduced in #487. |
Just adding a note here, I was struggling with this issue as well, instead of hiding the preview (you always need a visual feedback IMHO), this is what worked for me without freezing the browser (tested with ~20k images dropped in) var dropzoneBulkUpload = new Dropzone('div#productBulkImagesUpload', {
url: ProductsService().getEndpoint('bulkUploadMedia'),
uploadMultiple: false,
autoDiscover: false,
createImageThumbnails: false,
previewTemplate: '<div class="uploaded-image"><span data-dz-name></span> <strong class="dz-size" data-dz-size></strong><div class="dz-error-message" data-dz-errormessage></div><div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div></div>',
});
dropzoneBulkUpload.on('success', function (file, response) {
if (response.status === 'success') {
this.removeFile(file);
}
}); #productBulkImagesUpload {
max-height: 500px; // this is to prevent a very long page
overflow: scroll;
}
.uploaded-image {
border-bottom: 1px solid #eee;
.dz-progress {
display: block;
height: 5px;
.dz-upload {
display: block;
height: 100%;
background: #b7e2b7;
width: 0;
}
}
.dz-error-message {
color: red;
}
&.dz-complete .dz-progress {
display: none;
}
} This is a preview (you can make it look prettier) |
Is it true that it's not possible to upload without getting a preview afterwards??
I tried with an empty string for the previewTemplate option.. FAIL
The text was updated successfully, but these errors were encountered: