Make WordPress Core

Changeset 52288


Ignore:
Timestamp:
11/30/2021 07:05:52 PM (8 weeks ago)
Author:
hellofromTonya
Message:

Media: Use infiniteScrolling global setting in js/media/controllers/featured-image.js and js/media/controllers/replace-image.js.

Follow-up to [52287] which added an undefined variable. The variable should have been the global wp.media.view.settings.infiniteScrolling. This commit brings that global setting into each of the functions and renames the variable using camelCase to comply with JS coding standards.

Follow-up to [52287].

Props SergeyBiryukov.
Fixes #53765.

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

Legend:

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

    r52287 r52288  
    109109            library = this.get('library'),
    110110            id = wp.media.view.settings.post.featuredImageId,
     111            infiniteScrolling = wp.media.view.settings.infiniteScrolling,
    111112            attachment;
    112113
     
    118119        selection.reset( attachment ? [ attachment ] : [] );
    119120
    120         if ( ! infinite_scrolling && library.hasMore() ) {
     121        if ( ! infiniteScrolling && library.hasMore() ) {
    121122            library.more();
    122123        }
  • trunk/src/js/media/controllers/replace-image.js

    r52287 r52288  
    101101        var selection = this.get('selection'),
    102102            library = this.get('library'),
    103             attachment = this.image.attachment;
     103            attachment = this.image.attachment,
     104            infiniteScrolling = wp.media.view.settings.infiniteScrolling;
    104105
    105106        selection.reset( attachment ? [ attachment ] : [] );
    106107
    107         if ( ! infinite_scrolling && library.getTotalAttachments() == 0 && library.hasMore() ) {
     108        if ( ! infiniteScrolling && library.getTotalAttachments() === 0 && library.hasMore() ) {
    108109            library.more();
    109110        }
Note: See TracChangeset for help on using the changeset viewer.