Widgets: Prevent multiple items from being selectable when first populating a media widget.

Amends [40640].
Props obenland, timmydcrawford.
See #32417.

Built from https://develop.svn.wordpress.org/trunk@40827


git-svn-id: http://core.svn.wordpress.org/trunk@40684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-05-24 05:31:42 +00:00
parent 92d6abac47
commit 478d7730b6
3 changed files with 6 additions and 6 deletions

View File

@ -640,14 +640,14 @@ wp.mediaWidgets = ( function( $ ) {
* @returns {void}
*/
selectMedia: function selectMedia() {
var control = this, selection, mediaFrame, defaultSync, mediaFrameProps;
var control = this, selection, mediaFrame, defaultSync, mediaFrameProps, selectionModels = [];
if ( control.isSelected() && 0 !== control.model.get( 'attachment_id' ) ) {
selection = new wp.media.model.Selection([ control.selectedAttachment ]);
} else {
selection = null;
selectionModels.push( control.selectedAttachment );
}
selection = new wp.media.model.Selection( selectionModels, { multiple: false } );
mediaFrameProps = control.mapModelToMediaFrameProps( control.model.toJSON() );
if ( mediaFrameProps.size ) {
control.displaySettings.set( 'size', mediaFrameProps.size );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-beta2-40826';
$wp_version = '4.8-beta2-40827';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.