Defect #17151 » 17151.patch
| app/views/attachments/_form.html.erb | ||
|---|---|---|
|
:id => nil,
|
||
|
:class => 'file_selector',
|
||
|
:multiple => true,
|
||
|
:onchange => 'addInputFiles(this);',
|
||
|
:data => {
|
||
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||
| ... | ... | |
|
} %>
|
||
|
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||
|
</span>
|
||
|
<%= javascript_tag do %>
|
||
|
$('input.file_selector').on('change', function(){addInputFiles(this);});
|
||
|
<% end %>
|
||
|
<% content_for :header_tags do %>
|
||
|
<%= javascript_include_tag 'attachments' %>
|
||
| public/javascripts/attachments.js | ||
|---|---|---|
|
}
|
||
|
}
|
||
|
clearedFileInput.insertAfter('#attachments_fields');
|
||
|
clearedFileInput.insertAfter('#attachments_fields').on('change', function(){addInputFiles(this);});
|
||
|
}
|
||
|
function uploadAndAttachFiles(files, inputEl) {
|
||