Make WordPress Core

Changeset 22159


Ignore:
Timestamp:
10/10/2012 09:55:47 AM (14 years ago)
Author:
koopersmith
Message:

Show filenames for non-image attachments in the new media modal.

Also passes all attachment model attributes to the attachment view template by default (instead of selecting specific values).

see #21390, #21836.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/css/media-views.css

    r22158 r22159  
    257257        background: #eee;
    258258        cursor: pointer;
     259        color: #464646;
    259260
    260261        -webkit-user-select: none;
     
    307308        -o-transform:      translate( -50%, -50% );
    308309        transform:         translate( -50%, -50% );
     310}
     311
     312.attachment .filename {
     313        margin-top: 140px;
     314        padding: 0 10px;
     315        text-align: center;
     316        font-weight: bold;
    309317}
    310318
  • trunk/wp-includes/js/media-views.js

    r22157 r22159  
    407407                render: function() {
    408408                        var attachment = this.model.toJSON(),
    409                                 options = {
    410                                         icon:        attachment.icon,
    411                                         uploading:   attachment.uploading,
    412                                         orientation: attachment.orientation || 'landscape',
    413                                         type:        attachment.type,
    414                                         subtype:     attachment.subtype,
    415                                         buttons:     this.buttons
    416                                 };
    417 
    418 
    419                         if ( 'image' === attachment.type )
     409                                options = _.defaults( this.model.toJSON(), {
     410                                        orientation: 'landscape',
     411                                        uploading:   false,
     412                                        type:        ''
     413                                });
     414
     415                        options.buttons = this.buttons;
     416
     417                        if ( 'image' === options.type )
    420418                                _.extend( options, this.crop() );
    421419
    422420                        this.$el.html( this.template( options ) );
    423421
    424                         if ( attachment.uploading )
     422                        if ( options.uploading )
    425423                                this.$bar = this.$('.media-progress-bar div');
    426424                        else
  • trunk/wp-includes/media.php

    r22158 r22159  
    13341334                                        style="top:<%- top %>px; left:<%- left %>px;" />
    13351335                                </div>
     1336                        <% } else if ( uploading ) { %>
     1337                                <div class="media-progress-bar"><div></div></div>
    13361338                        <% } else { %>
    13371339                                <img src="<%- icon %>" class="icon" draggable="false" />
     1340                                <div class="filename"><%- filename %></div>
    13381341                        <% } %>
    13391342
    1340                         <% if ( uploading ) { %>
    1341                                 <div class="media-progress-bar"><div></div></div>
    1342                         <% } %>
     1343
    13431344
    13441345                        <% if ( buttons.close ) { %>
Note: See TracChangeset for help on using the changeset viewer.