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 419
419
xhr = options . xhr ? options . xhr ( ) : $ . ajaxSettings . xhr ( ) ;
420
420
// Accesss to the native XHR object is required to add event listeners
421
421
// for the upload progress event:
422
+ var first_occurrence = true
422
423
if ( xhr . upload ) {
423
424
$ ( xhr . upload ) . bind ( 'progress' , function ( e ) {
424
425
var oe = e . originalEvent ;
425
426
// Make sure the progress event properties get copied over:
426
427
e . lengthComputable = oe . lengthComputable ;
427
- e . loaded = oe . loaded ;
428
- e . total = oe . total ;
428
+ if ( first_occurrence == true ) {
429
+ oe . loaded = 0 ;
430
+ e . loaded = 0 ;
431
+ } else {
432
+ e . loaded = oe . loaded ;
433
+ first_occurrence = false ;
434
+ }
429
435
that . _onProgress ( e , options ) ;
430
436
} ) ;
431
437
options . xhr = function ( ) {
You can’t perform that action at this time.
0 commit comments