diff --git wp-includes/js/media-views.js wp-includes/js/media-views.js
index fa8a7c7..20f8276 100644
|
|
|
4699 | 4699 | |
4700 | 4700 | if ( options.rerenderOnModelChange ) { |
4701 | 4701 | this.model.on( 'change', this.render, this ); |
| 4702 | } else { |
| 4703 | this.model.on( 'change:percent', this.progress, this ); |
4702 | 4704 | } |
4703 | 4705 | this.model.on( 'change:title', this._syncTitle, this ); |
4704 | 4706 | this.model.on( 'change:caption', this._syncCaption, this ); |
4705 | 4707 | this.model.on( 'change:artist', this._syncArtist, this ); |
4706 | 4708 | this.model.on( 'change:album', this._syncAlbum, this ); |
4707 | | this.model.on( 'change:percent', this.progress, this ); |
4708 | 4709 | |
4709 | 4710 | // Update the selection. |
4710 | 4711 | this.model.on( 'add', this.select, this ); |
… |
… |
|
4772 | 4773 | options.allowLocalEdits = true; |
4773 | 4774 | } |
4774 | 4775 | |
| 4776 | if ( options.uploading && ! options.percent ) { |
| 4777 | options.percent = 0; |
| 4778 | } |
| 4779 | |
4775 | 4780 | this.views.detach(); |
4776 | 4781 | this.$el.html( this.template( options ) ); |
4777 | 4782 | |
4778 | 4783 | this.$el.toggleClass( 'uploading', options.uploading ); |
| 4784 | |
4779 | 4785 | if ( options.uploading ) { |
4780 | 4786 | this.$bar = this.$('.media-progress-bar div'); |
4781 | 4787 | } else { |
diff --git wp-includes/media-template.php wp-includes/media-template.php
index ef7c577..7609a40 100644
|
|
function wp_print_media_templates() { |
428 | 428 | <div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> |
429 | 429 | <div class="thumbnail"> |
430 | 430 | <# if ( data.uploading ) { #> |
431 | | <div class="media-progress-bar"><div> |
| 431 | <div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div> |
432 | 432 | <# } else if ( 'image' === data.type && data.sizes ) { #> |
433 | 433 | <div class="centered"> |
434 | 434 | <img src="{{ data.size.url }}" draggable="false" alt="" /> |