@@ -15,7 +15,6 | |||||
15 | :id => nil, |
|
15 | :id => nil, | |
16 | :class => 'file_selector', |
|
16 | :class => 'file_selector', | |
17 | :multiple => true, |
|
17 | :multiple => true, | |
18 | :onchange => 'addInputFiles(this);', |
|
|||
19 | :data => { |
|
18 | :data => { | |
20 | :max_file_size => Setting.attachment_max_size.to_i.kilobytes, |
|
19 | :max_file_size => Setting.attachment_max_size.to_i.kilobytes, | |
21 | :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), |
|
20 | :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), | |
@@ -25,6 +24,9 | |||||
25 | } %> |
|
24 | } %> | |
26 | (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) |
|
25 | (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) | |
27 | </span> |
|
26 | </span> | |
|
27 | <%= javascript_tag do %> | |||
|
28 | $('input.file_selector').on('change', function(){addInputFiles(this);}); | |||
|
29 | <% end %> | |||
28 |
|
30 | |||
29 | <% content_for :header_tags do %> |
|
31 | <% content_for :header_tags do %> | |
30 | <%= javascript_include_tag 'attachments' %> |
|
32 | <%= javascript_include_tag 'attachments' %> |
@@ -131,7 +131,7 function addInputFiles(inputEl) { | |||||
131 | } |
|
131 | } | |
132 | } |
|
132 | } | |
133 |
|
133 | |||
134 | clearedFileInput.insertAfter('#attachments_fields'); |
|
134 | clearedFileInput.insertAfter('#attachments_fields').on('change', function(){addInputFiles(this);}); | |
135 | } |
|
135 | } | |
136 |
|
136 | |||
137 | function uploadAndAttachFiles(files, inputEl) { |
|
137 | function uploadAndAttachFiles(files, inputEl) { |
General Comments 0
You need to be logged in to leave comments.
Login now