Project

General

Profile

Feature #18556 » attachments_3.4.4_increase_number_upload_files.diff

Jonathan Cormier, 2018-06-21 21:04

View differences:

attachments.js 2018-06-22 00:28:38.935785171 +0530
4 4
function addFile(inputEl, file, eagerUpload) {
5 5
  var attachmentsFields = $(inputEl).closest('.attachments_form').find('.attachments_fields');
6 6
  var addAttachment = $(inputEl).closest('.attachments_form').find('.add_attachment');
7
  var maxFiles = ($(inputEl).attr('multiple') == 'multiple' ? 10 : 1);
7
  var maxFiles = ($(inputEl).attr('multiple') == 'multiple' ? 100 : 1);
8 8

  
9 9
  if (attachmentsFields.children().length < maxFiles) {
10 10
    var attachmentId = addFile.nextAttachmentId++;
......
165 165
  if (sizeExceeded) {
166 166
    window.alert(maxFileSizeExceeded);
167 167
  } else {
168
    $.each(files, function() {addFile(inputEl, this, true);});
168
    $.each(files, function() {
169
      var ret = addFile(inputEl, this, true);
170
      if (ret == null) { 
171
        window.alert("Reached max number (100) of simulatenous uploaded files");
172
        return false; 
173
      }
174
    });
169 175
  }
170 176
  return sizeExceeded;
171 177
}
(2-2/3)