mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +00:00
Media modal: fix the progress bar in the attachment thumbnail. Props gcorne, fixes #29367
Built from https://develop.svn.wordpress.org/trunk@29609 git-svn-id: http://core.svn.wordpress.org/trunk@29383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
92ee5b230c
commit
04e28b468c
@ -4680,12 +4680,13 @@
|
|||||||
|
|
||||||
if ( options.rerenderOnModelChange ) {
|
if ( options.rerenderOnModelChange ) {
|
||||||
this.model.on( 'change', this.render, this );
|
this.model.on( 'change', this.render, this );
|
||||||
|
} else {
|
||||||
|
this.model.on( 'change:percent', this.progress, this );
|
||||||
}
|
}
|
||||||
this.model.on( 'change:title', this._syncTitle, this );
|
this.model.on( 'change:title', this._syncTitle, this );
|
||||||
this.model.on( 'change:caption', this._syncCaption, this );
|
this.model.on( 'change:caption', this._syncCaption, this );
|
||||||
this.model.on( 'change:artist', this._syncArtist, this );
|
this.model.on( 'change:artist', this._syncArtist, this );
|
||||||
this.model.on( 'change:album', this._syncAlbum, this );
|
this.model.on( 'change:album', this._syncAlbum, this );
|
||||||
this.model.on( 'change:percent', this.progress, this );
|
|
||||||
|
|
||||||
// Update the selection.
|
// Update the selection.
|
||||||
this.model.on( 'add', this.select, this );
|
this.model.on( 'add', this.select, this );
|
||||||
@ -4753,10 +4754,15 @@
|
|||||||
options.allowLocalEdits = true;
|
options.allowLocalEdits = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( options.uploading && ! options.percent ) {
|
||||||
|
options.percent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.views.detach();
|
this.views.detach();
|
||||||
this.$el.html( this.template( options ) );
|
this.$el.html( this.template( options ) );
|
||||||
|
|
||||||
this.$el.toggleClass( 'uploading', options.uploading );
|
this.$el.toggleClass( 'uploading', options.uploading );
|
||||||
|
|
||||||
if ( options.uploading ) {
|
if ( options.uploading ) {
|
||||||
this.$bar = this.$('.media-progress-bar div');
|
this.$bar = this.$('.media-progress-bar div');
|
||||||
} else {
|
} else {
|
||||||
|
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
@ -428,7 +428,7 @@ function wp_print_media_templates() {
|
|||||||
<div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
|
<div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
|
||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<# if ( data.uploading ) { #>
|
<# if ( data.uploading ) { #>
|
||||||
<div class="media-progress-bar"><div>
|
<div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div>
|
||||||
<# } else if ( 'image' === data.type && data.sizes ) { #>
|
<# } else if ( 'image' === data.type && data.sizes ) { #>
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
<img src="{{ data.size.url }}" draggable="false" alt="" />
|
<img src="{{ data.size.url }}" draggable="false" alt="" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user