summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-08-26 05:01:04 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-08-26 05:01:04 +0000
commit350accaeec43ea8791eb0318c01a35ef45dde9e6 (patch)
tree972d7c53a39193e342ac59b02eca901a73534451
parent3cc7d46335b879e8668b105beb7d3d429a1535f9 (diff)
downloadredmine-350accaeec43ea8791eb0318c01a35ef45dde9e6.tar.gz
redmine-350accaeec43ea8791eb0318c01a35ef45dde9e6.zip
Merged r13346 from trunk to 2.4-stable (#17581, #13932)
fix Drag & Drop does not work with Safari 5.1. Contributed by fred bregar. git-svn-id: http://svn.redmine.org/redmine/branches/2.4-stable@13349 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--public/javascripts/attachments.js6
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();