Make WordPress Core

Changeset 22543


Ignore:
Timestamp:
11/11/2012 05:16:41 AM (12 years ago)
Author:
koopersmith
Message:

Media: Ensure variables in the attachment details template have defined defaults.

  • Adds styling to the upload progress bar in the attachment details template.
  • Defines the filename attribute when Plupload creates the client-side Attachment model.

fixes #22410, see #21390.

Location:
trunk/wp-includes
Files:
4 edited

Legend:

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

    r22541 r22543  
    934934}
    935935
     936.uploading .attachment-info .thumbnail {
     937    width: 120px;
     938    height: 80px;
     939    box-shadow: inset 0 0 15px rgba( 0, 0, 0, 0.1 );
     940}
     941
     942.uploading .attachment-info .media-progress-bar {
     943    margin-top: 32px;
     944}
     945
    936946.attachment-info .thumbnail:after {
    937947    content: '';
  • trunk/wp-includes/js/media-views.js

    r22541 r22543  
    19551955            var attachment = this.model.toJSON(),
    19561956                options = _.defaults( this.model.toJSON(), {
    1957                     orientation: 'landscape',
    1958                     uploading:   false,
    1959                     type:        '',
    1960                     subtype:     '',
    1961                     icon:        '',
    1962                     filename:    '',
    1963                     caption:     '',
    1964                     title:       ''
     1957                    orientation:   'landscape',
     1958                    uploading:     false,
     1959                    type:          '',
     1960                    subtype:       '',
     1961                    icon:          '',
     1962                    filename:      '',
     1963                    caption:       '',
     1964                    title:         '',
     1965                    dateFormatted: '',
     1966                    width:         '',
     1967                    height:        '',
     1968                    compat:        false,
     1969                    alt:           ''
    19651970                });
    19661971
     
    19731978            this.$el.html( this.template( options ) );
    19741979
     1980            this.$el.toggleClass( 'uploading', options.uploading );
    19751981            if ( options.uploading )
    19761982                this.$bar = this.$('.media-progress-bar div');
  • trunk/wp-includes/js/plupload/wp-plupload.js

    r22320 r22543  
    148148                    file:      file,
    149149                    uploading: true,
    150                     date:      new Date()
     150                    date:      new Date(),
     151                    filename:  file.name
    151152                }, _.pick( file, 'loaded', 'size', 'percent' ) );
    152153
  • trunk/wp-includes/media.php

    r22541 r22543  
    14551455                <div class="filename">{{ filename }}</div>
    14561456                <div class="uploaded">{{ dateFormatted }}</div>
    1457                 <# if ( 'image' === type ) { #>
     1457                <# if ( 'image' === type && ! uploading ) { #>
    14581458                    <div class="dimensions">{{ width }} &times; {{ height }}</div>
    14591459                <# } #>
Note: See TracChangeset for help on using the changeset viewer.