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: http://core.svn.wordpress.org/trunk@22603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9f258e4342
commit
b19d48e7fe
|
@ -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