Make WordPress Core

Ticket #29367: 29367-01.patch

File 29367-01.patch, 1.8 KB (added by gcorne, 9 years ago)
  • wp-includes/js/media-views.js

    diff --git wp-includes/js/media-views.js wp-includes/js/media-views.js
    index fa8a7c7..20f8276 100644
     
    46994699
    47004700                        if ( options.rerenderOnModelChange ) {
    47014701                                this.model.on( 'change', this.render, this );
     4702                        } else {
     4703                                this.model.on( 'change:percent', this.progress, this );
    47024704                        }
    47034705                        this.model.on( 'change:title', this._syncTitle, this );
    47044706                        this.model.on( 'change:caption', this._syncCaption, this );
    47054707                        this.model.on( 'change:artist', this._syncArtist, this );
    47064708                        this.model.on( 'change:album', this._syncAlbum, this );
    4707                         this.model.on( 'change:percent', this.progress, this );
    47084709
    47094710                        // Update the selection.
    47104711                        this.model.on( 'add', this.select, this );
     
    47724773                                options.allowLocalEdits = true;
    47734774                        }
    47744775
     4776                        if ( options.uploading && ! options.percent ) {
     4777                                options.percent = 0;
     4778                        }
     4779
    47754780                        this.views.detach();
    47764781                        this.$el.html( this.template( options ) );
    47774782
    47784783                        this.$el.toggleClass( 'uploading', options.uploading );
     4784
    47794785                        if ( options.uploading ) {
    47804786                                this.$bar = this.$('.media-progress-bar div');
    47814787                        } else {
  • wp-includes/media-template.php

    diff --git wp-includes/media-template.php wp-includes/media-template.php
    index ef7c577..7609a40 100644
    function wp_print_media_templates() { 
    428428                <div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
    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">
    434434                                                <img src="{{ data.size.url }}" draggable="false" alt="" />