diff --git a/src/js/media/controllers/featured-image.js b/src/js/media/controllers/featured-image.js index e05b377be3..5fd5797bd0 100644 --- a/src/js/media/controllers/featured-image.js +++ b/src/js/media/controllers/featured-image.js @@ -108,6 +108,7 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot var selection = this.get('selection'), library = this.get('library'), id = wp.media.view.settings.post.featuredImageId, + infiniteScrolling = wp.media.view.settings.infiniteScrolling, attachment; if ( '' !== id && -1 !== id ) { @@ -117,7 +118,7 @@ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prot selection.reset( attachment ? [ attachment ] : [] ); - if ( ! infinite_scrolling && library.hasMore() ) { + if ( ! infiniteScrolling && library.hasMore() ) { library.more(); } } diff --git a/src/js/media/controllers/replace-image.js b/src/js/media/controllers/replace-image.js index 858e84c2d5..c400d22b10 100644 --- a/src/js/media/controllers/replace-image.js +++ b/src/js/media/controllers/replace-image.js @@ -100,11 +100,12 @@ ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.protot updateSelection: function() { var selection = this.get('selection'), library = this.get('library'), - attachment = this.image.attachment; + attachment = this.image.attachment, + infiniteScrolling = wp.media.view.settings.infiniteScrolling; selection.reset( attachment ? [ attachment ] : [] ); - if ( ! infinite_scrolling && library.getTotalAttachments() == 0 && library.hasMore() ) { + if ( ! infiniteScrolling && library.getTotalAttachments() === 0 && library.hasMore() ) { library.more(); } }