##// END OF EJS Templates
Save the selected file just in case uploading stuff fails/is not supported....
Jean-Philippe Lang -
r10781:39e7bab2b9ae
parent child
Show More
@@ -11,8 +11,9
11 <% end %>
11 <% end %>
12 </span>
12 </span>
13 <span class="add_attachment">
13 <span class="add_attachment">
14 <%= file_field_tag 'attachments_files',
14 <%= file_field_tag 'attachments[dummy][file]',
15 :id => nil,
15 :id => nil,
16 :class => 'file_selector',
16 :multiple => true,
17 :multiple => true,
17 :onchange => 'addInputFiles(this);',
18 :onchange => 'addInputFiles(this);',
18 :data => {
19 :data => {
@@ -156,8 +156,7 function handleFileDropEvent(e) {
156 blockEventPropagation(e);
156 blockEventPropagation(e);
157
157
158 if ($.inArray('Files', e.dataTransfer.types) > -1) {
158 if ($.inArray('Files', e.dataTransfer.types) > -1) {
159
159 uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector'));
160 uploadAndAttachFiles(e.dataTransfer.files, $('input:file[name=attachments_files]'));
161 }
160 }
162 }
161 }
163
162
@@ -1000,7 +1000,7 class IssuesControllerTest < ActionController::TestCase
1000 get :show, :id => 1
1000 get :show, :id => 1
1001
1001
1002 assert_select 'form#issue-form[method=post][enctype=multipart/form-data]' do
1002 assert_select 'form#issue-form[method=post][enctype=multipart/form-data]' do
1003 assert_select 'input[type=file][name=?]', 'attachments_files'
1003 assert_select 'input[type=file][name=?]', 'attachments[dummy][file]'
1004 end
1004 end
1005 end
1005 end
1006
1006
@@ -1569,7 +1569,7 class IssuesControllerTest < ActionController::TestCase
1569 get :new, :project_id => 1, :tracker_id => 1
1569 get :new, :project_id => 1, :tracker_id => 1
1570
1570
1571 assert_select 'form[id=issue-form][method=post][enctype=multipart/form-data]' do
1571 assert_select 'form[id=issue-form][method=post][enctype=multipart/form-data]' do
1572 assert_select 'input[name=?][type=file]', 'attachments_files'
1572 assert_select 'input[name=?][type=file]', 'attachments[dummy][file]'
1573 end
1573 end
1574 end
1574 end
1575
1575
General Comments 0
You need to be logged in to leave comments. Login now