Media modal/grid: remove thumbnail resizing from JS, only keep setting number of columns. Props avryl, see #27423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2014-08-05 05:20:18 +00:00
parent e1eab74aa6
commit e6b0d0c9ee
7 changed files with 298 additions and 291 deletions

View File

@@ -414,24 +414,26 @@ function wp_print_media_templates() {
<script type="text/html" id="tmpl-attachment">
<div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div></div></div>
<# } else if ( 'image' === data.type ) { #>
<div class="thumbnail">
<div class="thumbnail">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div>
<# } else if ( 'image' === data.type ) { #>
<div class="centered">
<img src="{{ data.size.url }}" draggable="false" alt="" />
</div>
</div>
<# } else {
if ( data.thumb && data.thumb.src && data.thumb.src !== data.icon ) {
#><img src="{{ data.thumb.src }}" class="thumbnail" draggable="false" /><#
} else {
#><img src="{{ data.icon }}" class="icon" draggable="false" /><#
} #>
<div class="filename">
<div>{{ data.filename }}</div>
</div>
<# } #>
<# } else { #>
<div class="centered">
<# if ( data.thumb && data.thumb.src && data.thumb.src !== data.icon ) { #>
<img src="{{ data.thumb.src }}" class="thumbnail" draggable="false" />
<# } else { #>
<img src="{{ data.icon }}" class="icon" draggable="false" />
<# } #>
</div>
<div class="filename">
<div>{{ data.filename }}</div>
</div>
<# } #>
</div>
<# if ( data.buttons.close ) { #>
<a class="close media-modal-icon" href="#" title="<?php esc_attr_e('Remove'); ?>"></a>
<# } #>
@@ -822,35 +824,6 @@ function wp_print_media_templates() {
</div>
</script>
<script type="text/html" id="tmpl-attachments-css">
<style type="text/css" id="{{ data.id }}-css">
#{{ data.id }} {
padding: 0 {{ data.gutter }}px;
}
#{{ data.id }} .attachment {
margin: {{ data.gutter }}px;
width: {{ data.edge }}px;
}
#{{ data.id }} .attachment-preview,
#{{ data.id }} .attachment-preview .thumbnail {
width: {{ data.edge }}px;
height: {{ data.edge }}px;
}
#{{ data.id }} .portrait .thumbnail img {
max-width: {{ data.edge }}px;
height: auto;
}
#{{ data.id }} .landscape .thumbnail img {
width: auto;
max-height: {{ data.edge }}px;
}
</style>
</script>
<script type="text/html" id="tmpl-image-details">
<div class="media-embed">
<div class="embed-media-settings">