WordPress.org

Make WordPress Core

Ticket #23317: media-views.diff

File media-views.diff, 663 bytes (added by kadamwhite, 14 months ago)

Patch to prevent submission of media frame if any selected attachment is still uploading

  • wp-includes/js/media-views.js

     
    24302430                                var requires = button.options.requires, 
    24312431                                        disabled = false; 
    24322432 
     2433                                // Prevent insertion of attachments if any of them are still uploading 
     2434                                disabled = _.some( selection.models, function( attachment ) { 
     2435                                        return attachment.get('uploading') === true; 
     2436                                }); 
     2437 
    24332438                                if ( requires.selection && selection && ! selection.length ) 
    24342439                                        disabled = true; 
    24352440                                else if ( requires.library && library && ! library.length )