Changeset 21784
- Timestamp:
- 09/07/2012 09:27:07 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r21773 r21784 528 528 var attachment = this.model.toJSON(), 529 529 options = { 530 thumbnail: 'image' === attachment.type ? attachment.url : attachment.icon, 531 uploading: attachment.uploading, 530 532 orientation: attachment.orientation || 'landscape', 531 t humbnail: attachment.url || '',532 uploading: attachment.uploading533 type: attachment.type, 534 subtype: attachment.subtype 533 535 }; 534 536 535 // Use the medium size if possible. If the medium size537 // Use the medium image size if possible. If the medium size 536 538 // doesn't exist, then the attachment is too small. 537 539 // In that case, use the attachment itself. … … 615 617 first = this.collection.first(); 616 618 sizes = first.get('sizes'); 617 options.thumbnail = ( sizes && sizes.thumbnail ) ? sizes.thumbnail.url : first.get('url'); 619 620 if ( 'image' === first.get('type') ) 621 options.thumbnail = ( sizes && sizes.thumbnail ) ? sizes.thumbnail.url : first.get('url'); 622 else 623 options.thumbnail = first.get('icon'); 618 624 619 625 this.$el.html( this.template( options ) ); -
trunk/wp-includes/media.php
r21778 r21784 1577 1577 'type' => $type, 1578 1578 'subtype' => $subtype, 1579 'icon' => wp_mime_type_icon( $attachment->post_mime_type ), 1579 1580 ); 1580 1581 … … 1647 1648 1648 1649 <script type="text/html" id="tmpl-attachment"> 1649 <div class="attachment-thumbnail <%- orientation %>">1650 <div class="attachment-thumbnail type-<%- type %> subtype-<%- subtype %> <%- orientation %>"> 1650 1651 <% if ( thumbnail ) { %> 1651 1652 <img src="<%- thumbnail %>" />
Note: See TracChangeset
for help on using the changeset viewer.