In `wp.Uploader`, when `uploader:ready` is triggered, set `ready` to `true` on the instance. This allows media workflows to check for an existing uploaded instance when opening.
Without this check, workflows might wait for `uploader:ready`, which could already have been fired. This would result in an unresponsive editor dropzone. Fixes #29689. git-svn-id: https://develop.svn.wordpress.org/trunk@29917 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f0b35fe7d5
commit
bd70f47d46
|
@ -3724,7 +3724,7 @@
|
|||
},
|
||||
|
||||
drop: function( event ) {
|
||||
var $wrap = null;
|
||||
var $wrap = null, uploadView;
|
||||
|
||||
this.containerDragleave( event );
|
||||
this.dropzoneDragleave( event );
|
||||
|
@ -3747,7 +3747,12 @@
|
|||
title: wp.media.view.l10n.addMedia,
|
||||
multiple: true
|
||||
});
|
||||
this.workflow.on( 'uploader:ready', this.addFiles, this );
|
||||
uploadView = this.workflow.uploader;
|
||||
if ( uploadView.uploader && uploadView.uploader.ready ) {
|
||||
this.addFiles.apply( this );
|
||||
} else {
|
||||
this.workflow.on( 'uploader:ready', this.addFiles, this );
|
||||
}
|
||||
} else {
|
||||
this.workflow.state().reset();
|
||||
this.addFiles.apply( this );
|
||||
|
|
|
@ -158,7 +158,8 @@ window.wp = window.wp || {};
|
|||
dropzone.trigger('dropzone:leave').removeClass('drag-over');
|
||||
}, 0 );
|
||||
});
|
||||
|
||||
|
||||
self.ready = true;
|
||||
$(self).trigger( 'uploader:ready' );
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue