diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-08-26 01:17:01 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-08-26 01:17:01 +0000 |
commit | 425761740a650f41f85c939a78bbcb4440bf3c49 (patch) | |
tree | c5d7f5fd0951b9fa648c32d2dcb8d0583ce5713a /public/javascripts/attachments.js | |
parent | 64255dc663357ff178e2e32c0fb144332f07dc9e (diff) | |
download | redmine-425761740a650f41f85c939a78bbcb4440bf3c49.tar.gz redmine-425761740a650f41f85c939a78bbcb4440bf3c49.zip |
fix Drag & Drop does not work with Safari 5.1 (#17581, #13932)
Contributed by fred bregar.
git-svn-id: http://svn.redmine.org/redmine/trunk@13346 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts/attachments.js')
-rw-r--r-- | public/javascripts/attachments.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 43803ba9c..a67ca4a72 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -99,8 +99,10 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) { return $.ajax(uploadUrl, { type: 'POST', contentType: 'application/octet-stream', - beforeSend: function(jqXhr) { + beforeSend: function(jqXhr, settings) { jqXhr.setRequestHeader('Accept', 'application/js'); + // attach proper File object + settings.data = blob; }, xhr: function() { var xhr = $.ajaxSettings.xhr(); @@ -117,7 +119,7 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) { function addInputFiles(inputEl) { var clearedFileInput = $(inputEl).clone().val(''); - if ('FileReader' in window && inputEl.files) { + if (inputEl.files) { // upload files using ajax uploadAndAttachFiles(inputEl.files, inputEl); $(inputEl).remove(); |