When creating a new playlist, we don't know from the model what "type" it is right away (there is no longer a video-playlist shortcode) - we need to check the controller's library's prop for type when deciding what settings to display in the modal.

See #27535.


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


git-svn-id: http://core.svn.wordpress.org/trunk@27646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-03-28 12:37:15 +00:00
parent 045e837577
commit eec578abcd

View File

@ -517,20 +517,21 @@ function wp_print_media_templates() {
<script type="text/html" id="tmpl-playlist-settings"> <script type="text/html" id="tmpl-playlist-settings">
<h3><?php _e( 'Playlist Settings' ); ?></h3> <h3><?php _e( 'Playlist Settings' ); ?></h3>
<# var emptyModel = _.isEmpty( data.model ); #> <# var emptyModel = _.isEmpty( data.model ),
isVideo = 'video' === data.controller.get('library').props.get('type'); #>
<label class="setting"> <label class="setting">
<input type="checkbox" data-setting="tracklist" <# if ( emptyModel ) { #> <input type="checkbox" data-setting="tracklist" <# if ( emptyModel ) { #>
checked="checked" checked="checked"
<# } #> /> <# } #> />
<# if ( 'audio' === data.model.type ) { #> <# if ( isVideo ) { #>
<span><?php _e( 'Show Tracklist' ); ?></span>
<# } else { #>
<span><?php _e( 'Show Video List' ); ?></span> <span><?php _e( 'Show Video List' ); ?></span>
<# } else { #>
<span><?php _e( 'Show Tracklist' ); ?></span>
<# } #> <# } #>
</label> </label>
<# if ( 'audio' === data.model.type ) { #> <# if ( ! isVideo ) { #>
<label class="setting"> <label class="setting">
<input type="checkbox" data-setting="artists" <# if ( emptyModel ) { #> <input type="checkbox" data-setting="artists" <# if ( emptyModel ) { #>
checked="checked" checked="checked"