Media: Allow multi-uploads in Galleries.

Previously, when more than one media item was uploaded using a gallery, failures occurred on the second upload.

Props glendaviesnz, Mista-Flo, hellofromTonya.
Fixes #53169.



git-svn-id: https://develop.svn.wordpress.org/trunk@51123 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Anthony Burchell
2021-06-08 23:12:23 +00:00
parent 38232f655d
commit 9f9261f051

View File

@@ -96,9 +96,11 @@ UploaderStatus = View.extend(/** @lends wp.media.view.UploaderStatus.prototype *
return attachment.get('uploading');
});
this.$index.text( index + 1 );
this.$total.text( queue.length );
this.$filename.html( active ? this.filename( active.get('filename') ) : '' );
if ( this.$index && this.$total && this.$filename ) {
this.$index.text( index + 1 );
this.$total.text( queue.length );
this.$filename.html( active ? this.filename( active.get('filename') ) : '' );
}
},
/**
* @param {string} filename