Skip to content

Commit

Permalink
fix: uploadButton data-max-filesize attribute is not passed to file-u…
Browse files Browse the repository at this point in the history
…ploader (#1503)
  • Loading branch information
fabien-michel authored Oct 16, 2024
1 parent efa9892 commit d72520c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions filer/static/filer/js/addons/upload-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if (django.jQuery) {
var infoMessage = $('.js-filer-dropzone-info-message');
var hiddenClass = 'hidden';
var maxUploaderConnections = uploadButton.data('max-uploader-connections') || 3;
var maxFilesize = parseInt(uploadButton.data('max-filesize') || 0, 10) * 1048576;
var hasErrors = false;
var updateUploadNumber = function () {
uploadNumber.text(maxSubmitNum - submitNum + '/' + maxSubmitNum);
Expand Down Expand Up @@ -59,6 +60,7 @@ if (django.jQuery) {
action: uploadUrl,
button: uploadButton[0],
maxConnections: maxUploaderConnections,
sizeLimit: maxFilesize,
onSubmit: function (id) {
Cl.mediator.remove('filer-upload-in-progress', removeButton);
Cl.mediator.publish('filer-upload-in-progress');
Expand Down

0 comments on commit d72520c

Please sign in to comment.