Project

General

Profile

Defect #17151 » 17151.patch

Felix Schäfer, 2014-06-25 14:11

View differences:

app/views/attachments/_form.html.erb
15 15
      :id => nil,
16 16
      :class => 'file_selector',
17 17
      :multiple => true,
18
      :onchange => 'addInputFiles(this);',
19 18
      :data => {
20 19
        :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
21 20
        :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
......
25 24
      } %>
26 25
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
27 26
</span>
27
<%= javascript_tag do %>
28
  $('input.file_selector').on('change', function(){addInputFiles(this);});
29
<% end %>
28 30

  
29 31
<% content_for :header_tags do %>
30 32
  <%= javascript_include_tag 'attachments' %>
public/javascripts/attachments.js
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 137
function uploadAndAttachFiles(files, inputEl) {
(2-2/3)