Make WordPress Core

Ticket #24355: 24355.diff

File 24355.diff, 948 bytes (added by kovshenin, 12 years ago)
  • wp-includes/js/media-views.js

     
    24282428                                var requires = button.options.requires,
    24292429                                        disabled = false;
    24302430
    2431                                 // Prevent insertion of attachments if any of them are still uploading
    24322431                                disabled = _.some( selection.models, function( attachment ) {
    2433                                         return attachment.get('uploading') === true;
     2432
     2433                                        // Prevent insertion of attachments if any of them are still uploading.
     2434                                        if ( attachment.get('uploading') === true )
     2435                                                return true;
     2436
     2437                                        // Prevent insertion of file types that do not match the library's current filter.
     2438                                        if ( library.props.get('type') && attachment.get('type') !== library.props.get('type') )
     2439                                                return true;
     2440
     2441                                        return false;
    24342442                                });
    24352443
    24362444                                if ( requires.selection && selection && ! selection.length )