File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/assets/javascripts/jquery-fileupload Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 412
412
xhr = options . xhr ? options . xhr ( ) : $ . ajaxSettings . xhr ( ) ;
413
413
// Accesss to the native XHR object is required to add event listeners
414
414
// for the upload progress event:
415
+ var first_occurrence = true
415
416
if ( xhr . upload ) {
416
417
$ ( xhr . upload ) . bind ( 'progress' , function ( e ) {
417
418
var oe = e . originalEvent ;
418
419
// Make sure the progress event properties get copied over:
419
420
e . lengthComputable = oe . lengthComputable ;
420
- e . loaded = oe . loaded ;
421
- e . total = oe . total ;
421
+ if ( first_occurrence == true ) {
422
+ oe . loaded = 0 ;
423
+ e . loaded = 0 ;
424
+ } else {
425
+ e . loaded = oe . loaded ;
426
+ first_occurrence = false ;
427
+ }
422
428
that . _onProgress ( e , options ) ;
423
429
} ) ;
424
430
options . xhr = function ( ) {
You can’t perform that action at this time.
0 commit comments