Media Grid: don't try to display images that don't have data.sizes set. Also, don't show the "Edit Image" button.

Props ocean90.
Fixes #29245.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-18 02:35:17 +00:00
parent 29a73daa74
commit c71437b94b

View File

@ -276,7 +276,7 @@ function wp_print_media_templates() {
<div class="thumbnail thumbnail-{{ data.type }}">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div></div></div>
<# } else if ( 'image' === data.type ) { #>
<# } else if ( 'image' === data.type && data.sizes && data.sizes.full ) { #>
<img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" />
<# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #>
<img class="details-image" src="{{ data.icon }}" class="icon" draggable="false" />
@ -310,7 +310,7 @@ function wp_print_media_templates() {
<# } #>
<div class="attachment-actions">
<# if ( 'image' === data.type && ! data.uploading ) { #>
<# if ( 'image' === data.type && ! data.uploading && data.sizes ) { #>
<a class="button edit-attachment" href="#"><?php _e( 'Edit Image' ); ?></a>
<# } #>
</div>
@ -425,7 +425,7 @@ function wp_print_media_templates() {
<div class="thumbnail">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div>
<# } else if ( 'image' === data.type ) { #>
<# } else if ( 'image' === data.type && data.sizes ) { #>
<div class="centered">
<img src="{{ data.size.url }}" draggable="false" alt="" />
</div>
@ -481,7 +481,7 @@ function wp_print_media_templates() {
<div class="thumbnail thumbnail-{{ data.type }}">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div></div></div>
<# } else if ( 'image' === data.type ) { #>
<# } else if ( 'image' === data.type && data.sizes ) { #>
<img src="{{ data.size.url }}" draggable="false" />
<# } else { #>
<img src="{{ data.icon }}" class="icon" draggable="false" />