Save the selected file just in case uploading stuff fails/is not supported.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11010 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-12-15 10:03:34 +00:00
parent 0d86303e3f
commit 39e7bab2b9
3 changed files with 5 additions and 5 deletions

View File

@ -11,8 +11,9 @@
<% end %>
</span>
<span class="add_attachment">
<%= file_field_tag 'attachments_files',
<%= file_field_tag 'attachments[dummy][file]',
:id => nil,
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:data => {

View File

@ -156,8 +156,7 @@ function handleFileDropEvent(e) {
blockEventPropagation(e);
if ($.inArray('Files', e.dataTransfer.types) > -1) {
uploadAndAttachFiles(e.dataTransfer.files, $('input:file[name=attachments_files]'));
uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector'));
}
}

View File

@ -1000,7 +1000,7 @@ class IssuesControllerTest < ActionController::TestCase
get :show, :id => 1
assert_select 'form#issue-form[method=post][enctype=multipart/form-data]' do
assert_select 'input[type=file][name=?]', 'attachments_files'
assert_select 'input[type=file][name=?]', 'attachments[dummy][file]'
end
end
@ -1569,7 +1569,7 @@ class IssuesControllerTest < ActionController::TestCase
get :new, :project_id => 1, :tracker_id => 1
assert_select 'form[id=issue-form][method=post][enctype=multipart/form-data]' do
assert_select 'input[name=?][type=file]', 'attachments_files'
assert_select 'input[name=?][type=file]', 'attachments[dummy][file]'
end
end