Media: Update in-grid captions.
* Use input fields instead of textboxes (which provide better handling for smaller attachments). * Provide `data-setting` properties to properly sync the changes. see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c20cd04a7b
commit
ee694739ec
@ -603,7 +603,6 @@
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
margin: -1px 0 0;
|
||||
padding: 8px;
|
||||
font-size: 12px;
|
||||
|
@ -1447,19 +1447,17 @@ function wp_print_media_templates( $attachment ) {
|
||||
</div>
|
||||
<# if ( data.describe ) { #>
|
||||
<# if ( 'image' === data.type ) { #>
|
||||
<textarea class="describe"
|
||||
placeholder="<?php esc_attr_e('Describe this image…'); ?>"
|
||||
>{{ data.caption }}</textarea>
|
||||
<input type="text" value="{{ data.caption }}" class="describe" data-setting="caption"
|
||||
placeholder="<?php esc_attr_e('Describe this image…'); ?>" />
|
||||
<# } else { #>
|
||||
<textarea class="describe"
|
||||
<input type="text" value="{{ data.title }}" class="describe" data-setting="title"
|
||||
<# if ( 'video' === data.type ) { #>
|
||||
placeholder="<?php esc_attr_e('Describe this video…'); ?>"
|
||||
<# } else if ( 'audio' === data.type ) { #>
|
||||
placeholder="<?php esc_attr_e('Describe this audio file…'); ?>"
|
||||
<# } else { #>
|
||||
placeholder="<?php esc_attr_e('Describe this media file…'); ?>"
|
||||
<# } #>
|
||||
>{{ data.title }}</textarea>
|
||||
<# } #> />
|
||||
<# } #>
|
||||
<# } #>
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user