Make WordPress Core

Changeset 52287


Ignore:
Timestamp:
11/30/2021 06:06:43 PM (2 months ago)
Author:
hellofromTonya
Message:

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.

Location:
trunk/src/js/media/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/controllers/featured-image.js

    r52167 r52287  
    118118        selection.reset( attachment ? [ attachment ] : [] );
    119119
    120         if ( library.hasMore() ) {
     120        if ( ! infinite_scrolling && library.hasMore() ) {
    121121            library.more();
    122122        }
  • trunk/src/js/media/controllers/replace-image.js

    r52167 r52287  
    105105        selection.reset( attachment ? [ attachment ] : [] );
    106106
    107         if ( library.hasMore() ) {
     107        if ( ! infinite_scrolling && library.getTotalAttachments() == 0 && library.hasMore() ) {
    108108            library.more();
    109109        }
Note: See TracChangeset for help on using the changeset viewer.