|
|
|
|
|
|
|
|
xhr: function() |
|
|
xhr: function() |
|
|
{ |
|
|
{ |
|
|
var xhr = $.ajaxSettings.xhr(); |
|
|
var xhr = $.ajaxSettings.xhr(); |
|
|
xhr.upload.addEventListener("progress", (function(evt){ |
|
|
|
|
|
|
|
|
xhr.upload.addEventListener("progress", (function(){ |
|
|
var id = e.data; |
|
|
var id = e.data; |
|
|
return function() { |
|
|
|
|
|
|
|
|
return function(evt) { |
|
|
if (evt.lengthComputable) { |
|
|
if (evt.lengthComputable) { |
|
|
var progress = Math.floor(evt.loaded / evt.total * 50); |
|
|
var progress = Math.floor(evt.loaded / evt.total * 50); |
|
|
if ( progress < 1 ) { progress = 1; } |
|
|
if ( progress < 1 ) { progress = 1; } |