]> source.dussan.org Git - redmine.git/commitdiff
Save the selected file just in case uploading stuff fails/is not supported.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 15 Dec 2012 10:03:34 +0000 (10:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 15 Dec 2012 10:03:34 +0000 (10:03 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11010 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/attachments/_form.html.erb
public/javascripts/attachments.js
test/functional/issues_controller_test.rb

index ca7558a706b892223be5cb85becf6257b887f96e..65ad8804a4ccae7badd6ac28281e1f5d589412ab 100644 (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 => {
index e99f2ac7cdefa6327149a350fdc77c346823c295..deac4eb006a019d3399854958994531b6864fddc 100644 (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'));
   }
 }
 
index 6c0ea7fcac8ff031fcc3d33bd405018ca8fa9427..f3632e83dd027abce75d82e2e3d2a7ab0e987d30 100644 (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