mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-06 02:00:05 +00:00
Media: Featured image modal loads only selected image when infinite scroll is disabled.
Follow-up to [52167], which partially fixed a bug introduced in [50829] that caused media modal to only load the selected image. This commit adds additional checks to ensure infinite scroll is disabled. Follow-up to [50829], [52167]. Props dariak, joedolson, szaqal21. Fixes #53765. git-svn-id: https://develop.svn.wordpress.org/trunk@52287 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -117,7 +117,7 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot
|
||||
|
||||
selection.reset( attachment ? [ attachment ] : [] );
|
||||
|
||||
if ( library.hasMore() ) {
|
||||
if ( ! infinite_scrolling && library.hasMore() ) {
|
||||
library.more();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.protot
|
||||
|
||||
selection.reset( attachment ? [ attachment ] : [] );
|
||||
|
||||
if ( library.hasMore() ) {
|
||||
if ( ! infinite_scrolling && library.getTotalAttachments() == 0 && library.hasMore() ) {
|
||||
library.more();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user