Media Grid: don't auto-select attachments upon upload.
Props ocean90. See #28842. Built from https://develop.svn.wordpress.org/trunk@29565 git-svn-id: http://core.svn.wordpress.org/trunk@29339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d6213d64a5
commit
ca180e2544
|
@ -135,7 +135,8 @@
|
|||
content: 'browse',
|
||||
toolbar: 'select',
|
||||
contentUserSetting: false,
|
||||
filterable: 'all'
|
||||
filterable: 'all',
|
||||
autoSelect: false
|
||||
})
|
||||
]);
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -595,6 +595,7 @@
|
|||
filterable: false,
|
||||
sortable: true,
|
||||
|
||||
autoSelect: true,
|
||||
describe: false,
|
||||
// Uses a user setting to override the content mode.
|
||||
contentUserSetting: true,
|
||||
|
@ -751,9 +752,11 @@
|
|||
if ( 'upload' === content.mode() ) {
|
||||
this.frame.content.mode('browse');
|
||||
}
|
||||
this.get('selection').add( attachment );
|
||||
|
||||
this.frame.trigger( 'library:selection:add' );
|
||||
if ( this.get( 'autoSelect' ) ) {
|
||||
this.get('selection').add( attachment );
|
||||
this.frame.trigger( 'library:selection:add' );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -5705,7 +5708,7 @@
|
|||
};
|
||||
|
||||
if ( media.view.settings.mediaTrash &&
|
||||
this.controller.activeModes.where( { id: 'grid' } ).length ) {
|
||||
this.controller.isModeActive( 'grid' ) ) {
|
||||
|
||||
filters.trash = {
|
||||
text: l10n.trash,
|
||||
|
@ -5821,7 +5824,7 @@
|
|||
// Feels odd to bring the global media library switcher into the Attachment
|
||||
// browser view. Is this a use case for doAction( 'add:toolbar-items:attachments-browser', this.toolbar );
|
||||
// which the controller can tap into and add this view?
|
||||
if ( this.controller.activeModes.where( { id: 'grid' } ).length ) {
|
||||
if ( this.controller.isModeActive( 'grid' ) ) {
|
||||
LibraryViewSwitcher = media.View.extend({
|
||||
className: 'view-switch media-grid-view-switch',
|
||||
template: media.template( 'media-library-view-switcher')
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue