##// END OF EJS Templates
fix Drag & Drop does not work with Safari 5.1 (#17581, #13932)...
Toshi MARUYAMA -
r12992:425761740a65
parent child
Show More
@@ -99,8 +99,10 function uploadBlob(blob, uploadUrl, attachmentId, options) {
99 return $.ajax(uploadUrl, {
99 return $.ajax(uploadUrl, {
100 type: 'POST',
100 type: 'POST',
101 contentType: 'application/octet-stream',
101 contentType: 'application/octet-stream',
102 beforeSend: function(jqXhr) {
102 beforeSend: function(jqXhr, settings) {
103 jqXhr.setRequestHeader('Accept', 'application/js');
103 jqXhr.setRequestHeader('Accept', 'application/js');
104 // attach proper File object
105 settings.data = blob;
104 },
106 },
105 xhr: function() {
107 xhr: function() {
106 var xhr = $.ajaxSettings.xhr();
108 var xhr = $.ajaxSettings.xhr();
@@ -117,7 +119,7 function uploadBlob(blob, uploadUrl, attachmentId, options) {
117 function addInputFiles(inputEl) {
119 function addInputFiles(inputEl) {
118 var clearedFileInput = $(inputEl).clone().val('');
120 var clearedFileInput = $(inputEl).clone().val('');
119
121
120 if ('FileReader' in window && inputEl.files) {
122 if (inputEl.files) {
121 // upload files using ajax
123 // upload files using ajax
122 uploadAndAttachFiles(inputEl.files, inputEl);
124 uploadAndAttachFiles(inputEl.files, inputEl);
123 $(inputEl).remove();
125 $(inputEl).remove();
General Comments 0
You need to be logged in to leave comments. Login now