From ce36b0b5f06e2fa35017fd7c4f669e356eff1422 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Thu, 11 Oct 2012 00:28:01 +0000 Subject: [PATCH] Media Modal: Only automatically select uploading attachments when in a workflow that supports multiple images. Fixes a bug in featured images where uploading an image would force you to reopen the modal (as the modal would close on upload). see #21390, #21776. git-svn-id: http://core.svn.wordpress.org/trunk@22175 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/media-views.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 19238fd913..57e63bbc9c 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -612,7 +612,11 @@ // Track uploading attachments. wp.Uploader.queue.on( 'add remove reset change:percent', this.renderUploadProgress, this ); - wp.Uploader.queue.on( 'add', this.selectUpload, this ); + + // If we're in a workflow that supports multiple attachments, + // automatically select any uploading attachments. + if ( this.controller.get('multiple') ) + wp.Uploader.queue.on( 'add', this.selectUpload, this ); }, render: function() {