WordPress.org

Make WordPress Core

Changeset 29609


Ignore:
Timestamp:
08/25/2014 10:44:32 PM (5 years ago)
Author:
azaozz
Message:

Media modal: fix the progress bar in the attachment thumbnail. Props gcorne, fixes #29367

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r29602 r29609  
    46814681            if ( options.rerenderOnModelChange ) {
    46824682                this.model.on( 'change', this.render, this );
     4683            } else {
     4684                this.model.on( 'change:percent', this.progress, this );
    46834685            }
    46844686            this.model.on( 'change:title', this._syncTitle, this );
     
    46864688            this.model.on( 'change:artist', this._syncArtist, this );
    46874689            this.model.on( 'change:album', this._syncAlbum, this );
    4688             this.model.on( 'change:percent', this.progress, this );
    46894690
    46904691            // Update the selection.
     
    47544755            }
    47554756
     4757            if ( options.uploading && ! options.percent ) {
     4758                options.percent = 0;
     4759            }
     4760
    47564761            this.views.detach();
    47574762            this.$el.html( this.template( options ) );
    47584763
    47594764            this.$el.toggleClass( 'uploading', options.uploading );
     4765
    47604766            if ( options.uploading ) {
    47614767                this.$bar = this.$('.media-progress-bar div');
  • trunk/src/wp-includes/media-template.php

    r29537 r29609  
    429429            <div class="thumbnail">
    430430                <# if ( data.uploading ) { #>
    431                     <div class="media-progress-bar"><div>
     431                    <div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div>
    432432                <# } else if ( 'image' === data.type && data.sizes ) { #>
    433433                    <div class="centered">
Note: See TracChangeset for help on using the changeset viewer.