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 // Add all items in the selection to the library, so any featured
// images that are not initially loaded still appear. // images that are not initially loaded still appear.
library.observe( this.get('selection') ); 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' ), selection = state.get( 'selection' ),
attachment = selection.single(); attachment = selection.single();
controller.media.changeAttachment( attachment, state.display( attachment ) ); controller.media.changeAttachment( attachment );
state.trigger( 'replace', controller.media.toJSON() ); state.trigger( 'replace', controller.media.toJSON() );
@ -2844,7 +2830,7 @@
selection = state.get( 'selection' ), selection = state.get( 'selection' ),
attachment = selection.single(); attachment = selection.single();
controller.media.setSource( attachment, state.display( attachment ) ); controller.media.setSource( attachment );
state.trigger( 'add-source', controller.media.toJSON() ); state.trigger( 'add-source', controller.media.toJSON() );
@ -2915,7 +2901,6 @@
menu: 'audio-details' menu: 'audio-details'
} ), } ),
new media.controller.MediaLibrary( { new media.controller.MediaLibrary( {
type: 'audio', type: 'audio',
id: 'add-audio-source', 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 { .media-embed-details .instructions {
padding: 16px; padding: 16px 0;
max-width: 600px; max-width: 600px;
} }
@ -37,7 +37,7 @@
} }
.media-embed-details .embed-media-settings { .media-embed-details .embed-media-settings {
top: 70px; top: 0;
} }
.media-embed-details .embed-media-settings .checkbox-setting { .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"> <script type="text/html" id="tmpl-audio-details">
<?php $audio_types = wp_get_audio_extensions(); ?> <?php $audio_types = wp_get_audio_extensions(); ?>
<div class="media-embed media-embed-details"> <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="embed-media-settings embed-audio-settings">
<div class="instructions media-instructions">{{{ wp.media.view.l10n.audioDetailsText }}}</div>
<audio controls <audio controls
class="wp-audio-shortcode" class="wp-audio-shortcode"
preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}" 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"> <script type="text/html" id="tmpl-video-details">
<?php $video_types = wp_get_video_extensions(); ?> <?php $video_types = wp_get_video_extensions(); ?>
<div class="media-embed media-embed-details"> <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="embed-media-settings embed-video-settings">
<div class="instructions media-instructions">{{{ wp.media.view.l10n.videoDetailsText }}}</div>
<div class="wp-video-holder"> <div class="wp-video-holder">
<# <#
var isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/); var isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/);