mirror of
git://develop.git.wordpress.org/
synced 2025-04-02 19:22:34 +02:00
Media: Featured image modal loads only selected image.
Fix bug introduced in [50829] that caused media modal to only load the selected image. Executes `.more()` when loading the modal to ensure that the media collection is available. Props benitolopez, hellofromTonya, peterwilsoncc, danielbachhuber, PieWP, sabernhardt, szaqal21. Fixes #53765. git-svn-id: https://develop.svn.wordpress.org/trunk@52167 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1fcde43588
commit
2049f04b4d
@ -87,7 +87,6 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot
|
||||
* @since 3.5.0
|
||||
*/
|
||||
activate: function() {
|
||||
this.updateSelection();
|
||||
this.frame.on( 'open', this.updateSelection, this );
|
||||
|
||||
Library.prototype.activate.apply( this, arguments );
|
||||
@ -107,6 +106,7 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot
|
||||
*/
|
||||
updateSelection: function() {
|
||||
var selection = this.get('selection'),
|
||||
library = this.get('library'),
|
||||
id = wp.media.view.settings.post.featuredImageId,
|
||||
attachment;
|
||||
|
||||
@ -116,6 +116,10 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot
|
||||
}
|
||||
|
||||
selection.reset( attachment ? [ attachment ] : [] );
|
||||
|
||||
if ( library.hasMore() ) {
|
||||
library.more();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -99,9 +99,14 @@ ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.protot
|
||||
*/
|
||||
updateSelection: function() {
|
||||
var selection = this.get('selection'),
|
||||
library = this.get('library'),
|
||||
attachment = this.image.attachment;
|
||||
|
||||
selection.reset( attachment ? [ attachment ] : [] );
|
||||
|
||||
if ( library.hasMore() ) {
|
||||
library.more();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user