Since audio and video shortcodes don't point at actual attachments, don't persist the library's selection. Move the media instructions in the block that scrolls.

See #27016.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-03-09 06:24:15 +00:00
parent 90da8aab4a
commit 8e2e99fd0c
4 changed files with 9 additions and 24 deletions

View File

@ -1228,20 +1228,6 @@
// Add all items in the selection to the library, so any featured
// images that are not initially loaded still appear.
library.observe( this.get('selection') );
},
activate: function() {
this.updateSelection();
media.controller.Library.prototype.activate.apply( this, arguments );
},
updateSelection: function() {
var selection = this.get('selection'),
attachment;
attachment = this.media.attachment;
selection.reset( attachment ? [ attachment ] : [] );
}
});
@ -2816,7 +2802,7 @@
selection = state.get( 'selection' ),
attachment = selection.single();
controller.media.changeAttachment( attachment, state.display( attachment ) );
controller.media.changeAttachment( attachment );
state.trigger( 'replace', controller.media.toJSON() );
@ -2844,7 +2830,7 @@
selection = state.get( 'selection' ),
attachment = selection.single();
controller.media.setSource( attachment, state.display( attachment ) );
controller.media.setSource( attachment );
state.trigger( 'add-source', controller.media.toJSON() );
@ -2915,7 +2901,6 @@
menu: 'audio-details'
} ),
new media.controller.MediaLibrary( {
type: 'audio',
id: 'add-audio-source',

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@
}
.media-embed-details .instructions {
padding: 16px;
padding: 16px 0;
max-width: 600px;
}
@ -37,7 +37,7 @@
}
.media-embed-details .embed-media-settings {
top: 70px;
top: 0;
}
.media-embed-details .embed-media-settings .checkbox-setting {

View File

@ -664,8 +664,8 @@ function wp_print_media_templates() {
<script type="text/html" id="tmpl-audio-details">
<?php $audio_types = wp_get_audio_extensions(); ?>
<div class="media-embed media-embed-details">
<div class="instructions media-instructions">{{{ wp.media.view.l10n.audioDetailsText }}}</div>
<div class="embed-media-settings embed-audio-settings">
<div class="instructions media-instructions">{{{ wp.media.view.l10n.audioDetailsText }}}</div>
<audio controls
class="wp-audio-shortcode"
preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}"
@ -731,8 +731,8 @@ function wp_print_media_templates() {
<script type="text/html" id="tmpl-video-details">
<?php $video_types = wp_get_video_extensions(); ?>
<div class="media-embed media-embed-details">
<div class="instructions media-instructions">{{{ wp.media.view.l10n.videoDetailsText }}}</div>
<div class="embed-media-settings embed-video-settings">
<div class="instructions media-instructions">{{{ wp.media.view.l10n.videoDetailsText }}}</div>
<div class="wp-video-holder">
<#
var isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/);