This repository was archived by the owner on May 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 570570 . done ( function ( result , textStatus , jqXHR ) {
571571 ub = that . _getUploadedBytes ( jqXHR ) ||
572572 ( 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 ) {
576577 that . _onProgress ( $ . Event ( 'progress' , {
577578 lengthComputable : true ,
578579 loaded : ub - o . uploadedBytes ,
632633 } ,
633634
634635 _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:
637642 this . _onProgress ( $ . Event ( 'progress' , {
638643 lengthComputable : true ,
639- loaded : 1 ,
640- total : 1
644+ loaded : total ,
645+ total : total
641646 } ) , options ) ;
642647 }
643648 options . result = result ;
You can’t perform that action at this time.
0 commit comments