This repository was archived by the owner on May 25, 2023. It is now read-only.
File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 570
570
. done ( function ( result , textStatus , jqXHR ) {
571
571
ub = that . _getUploadedBytes ( jqXHR ) ||
572
572
( ub + o . chunkSize ) ;
573
- // Create a progress event if upload is done and
574
- // no progress event has been invoked for this chunk:
575
- if ( ! o . loaded ) {
573
+ // Create a progress event if upload is done and no progress
574
+ // event has been invoked for this chunk, or there has been
575
+ // no progress event with loaded equaling total:
576
+ if ( ! o . loaded || o . loaded < o . total ) {
576
577
that . _onProgress ( $ . Event ( 'progress' , {
577
578
lengthComputable : true ,
578
579
loaded : ub - o . uploadedBytes ,
632
633
} ,
633
634
634
635
_onDone : function ( result , textStatus , jqXHR , options ) {
635
- if ( ! this . _isXHRUpload ( options ) ) {
636
- // Create a progress event for each iframe load:
636
+ if ( ! this . _isXHRUpload ( options ) || ! options . loaded ||
637
+ options . loaded < options . total ) {
638
+ var total = this . _getTotal ( options . files ) || 1 ;
639
+ // Create a progress event for each iframe load,
640
+ // or if there has been no progress event with
641
+ // loaded equaling total for XHR uploads:
637
642
this . _onProgress ( $ . Event ( 'progress' , {
638
643
lengthComputable : true ,
639
- loaded : 1 ,
640
- total : 1
644
+ loaded : total ,
645
+ total : total
641
646
} ) , options ) ;
642
647
}
643
648
options . result = result ;
You can’t perform that action at this time.
0 commit comments