Media: Automatically select uploading attachments in single-select workflows.

The code now automatically selects uploading attachments in all workflows. In a workflow that selects multiple attachments, all attachments added to the upload queue are selected. In a workflow that selects a single attachment (e.g. selecting a featured image), the last attachment added to the upload queue is selected.

see #22817.


git-svn-id: https://develop.svn.wordpress.org/trunk@23259 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2013-01-04 06:44:21 +00:00
parent 46e1c12b98
commit 45d01dad51
1 changed files with 6 additions and 4 deletions

View File

@ -533,10 +533,12 @@
if ( 'upload' === content.mode() )
this.frame.content.mode('browse');
// If we're in a workflow that supports multiple attachments,
// automatically select any uploading attachments.
if ( this.get('multiple') )
this.get('selection').add( attachment );
// Automatically select any uploading attachments.
//
// Selections that don't support multiple attachments automatically
// limit themselves to one attachment (in this case, the last
// attachment in the upload queue).
this.get('selection').add( attachment );
},
saveContentMode: function() {