mirror of
git://develop.git.wordpress.org/
synced 2025-03-20 12:00:03 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52288 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
aaded1d17e
commit
73ddcbda65
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user