Make WordPress Core

Changeset 29565


Ignore:
Timestamp:
08/21/2014 03:53:13 AM (12 years ago)
Author:
wonderboymusic
Message:

Media Grid: don't auto-select attachments upon upload.

Props ocean90.
See #28842.

Location:
trunk/src/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-grid.js

    r29560 r29565  
    136136                                        toolbar:            'select',
    137137                                        contentUserSetting: false,
    138                                         filterable:         'all'
     138                                        filterable:         'all',
     139                                        autoSelect:         false
    139140                                })
    140141                        ]);
  • trunk/src/wp-includes/js/media-views.js

    r29562 r29565  
    596596                        sortable:           true,
    597597
     598                        autoSelect:         true,
    598599                        describe:           false,
    599600                        // Uses a user setting to override the content mode.
    … …  
    752753                                this.frame.content.mode('browse');
    753754                        }
    754                         this.get('selection').add( attachment );
    755 
    756                         this.frame.trigger( 'library:selection:add' );
     755
     756                        if ( this.get( 'autoSelect' ) ) {
     757                                this.get('selection').add( attachment );
     758                                this.frame.trigger( 'library:selection:add' );
     759                        }
    757760                },
    758761
    … …  
    57065709
    57075710                        if ( media.view.settings.mediaTrash &&
    5708                                 this.controller.activeModes.where( { id: 'grid' } ).length ) {
     5711                                this.controller.isModeActive( 'grid' ) ) {
    57095712
    57105713                                filters.trash = {
    … …  
    58225825                        // browser view. Is this a use case for doAction( 'add:toolbar-items:attachments-browser', this.toolbar );
    58235826                        // which the controller can tap into and add this view?
    5824                         if ( this.controller.activeModes.where( { id: 'grid' } ).length ) {
     5827                        if ( this.controller.isModeActive( 'grid' ) ) {
    58255828                                LibraryViewSwitcher = media.View.extend({
    58265829                                        className: 'view-switch media-grid-view-switch',
Note: See TracChangeset for help on using the changeset viewer.