summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-07-01 05:25:24 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-07-01 05:25:24 +0000
commit5baf46b64019f6905ab728940cf77b15cc8071fe (patch)
tree4ba53f3f002abf02e5e8303d43122a9e419d2fea
parent5ecad330d95f7d3073f633b9cb8ee597fd4c5877 (diff)
downloadredmine-5baf46b64019f6905ab728940cf77b15cc8071fe.tar.gz
redmine-5baf46b64019f6905ab728940cf77b15cc8071fe.zip
Merged r13199 from trunk to 2.5-stable (#17151)
Fix file upload broken on Chrome 36. Contributed by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13201 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/attachments/_form.html.erb4
-rw-r--r--public/javascripts/attachments.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb
index 65ad8804a..26ff5c96a 100644
--- a/app/views/attachments/_form.html.erb
+++ b/app/views/attachments/_form.html.erb
@@ -15,7 +15,6 @@
: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)),
@@ -25,6 +24,9 @@
} %>
(<%= 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' %>
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index a689c2ef3..43803ba9c 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -131,7 +131,7 @@ function addInputFiles(inputEl) {
}
}
- clearedFileInput.insertAfter('#attachments_fields');
+ clearedFileInput.insertAfter('#attachments_fields').on('change', function(){addInputFiles(this);});
}
function uploadAndAttachFiles(files, inputEl) {