Media: in wp.media.view.Toolbar.refresh(), check for a selection before iterating over models.
Props chandrapatel. Fixes #39511. Built from https://develop.svn.wordpress.org/trunk@40050 git-svn-id: http://core.svn.wordpress.org/trunk@39987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -7724,9 +7724,11 @@ Toolbar = View.extend({
|
||||
disabled = false;
|
||||
|
||||
// Prevent insertion of attachments if any of them are still uploading
|
||||
disabled = _.some( selection.models, function( attachment ) {
|
||||
return attachment.get('uploading') === true;
|
||||
});
|
||||
if ( selection && selection.models ) {
|
||||
disabled = _.some( selection.models, function( attachment ) {
|
||||
return attachment.get('uploading') === true;
|
||||
});
|
||||
}
|
||||
|
||||
if ( requires.selection && selection && ! selection.length ) {
|
||||
disabled = true;
|
||||
|
||||
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user