Make WordPress Core


Ignore:
Timestamp:
03/28/2014 12:36:41 PM (10 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r27797 r27812  
    518518        <h3><?php _e( 'Playlist Settings' ); ?></h3>
    519519
    520         <# var emptyModel = _.isEmpty( data.model );  #>
     520        <# var emptyModel = _.isEmpty( data.model ),
     521            isVideo = 'video' === data.controller.get('library').props.get('type'); #>
    521522
    522523        <label class="setting">
     
    524525                checked="checked"
    525526            <# } #> />
    526             <# if ( 'audio' === data.model.type ) { #>
     527            <# if ( isVideo ) { #>
     528            <span><?php _e( 'Show Video List' ); ?></span>
     529            <# } else { #>
    527530            <span><?php _e( 'Show Tracklist' ); ?></span>
    528             <# } else { #>
    529             <span><?php _e( 'Show Video List' ); ?></span>
    530531            <# } #>
    531532        </label>
    532533
    533         <# if ( 'audio' === data.model.type ) { #>
     534        <# if ( ! isVideo ) { #>
    534535        <label class="setting">
    535536            <input type="checkbox" data-setting="artists" <# if ( emptyModel ) { #>
Note: See TracChangeset for help on using the changeset viewer.