Media: Fix JS error in Media Library when infinite scroll enabled.

Wrap call to this.updateLoadMoreView() is wrapped in a check that infinite scroll is disabled to prevent JS errors.

Props wildworks.
Fixes #53672.
Built from https://develop.svn.wordpress.org/trunk@51440


git-svn-id: http://core.svn.wordpress.org/trunk@51051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2021-07-15 17:00:59 +00:00
parent 1c4ec82ce7
commit f0e5f17c2c
3 changed files with 6 additions and 3 deletions

View File

@ -2074,7 +2074,10 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
} }
this.updateContent(); this.updateContent();
this.updateLoadMoreView();
if ( ! infiniteScrolling ) {
this.updateLoadMoreView();
}
if ( ! this.options.sidebar || 'errors' === this.options.sidebar ) { if ( ! this.options.sidebar || 'errors' === this.options.sidebar ) {
this.$el.addClass( 'hide-sidebar' ); this.$el.addClass( 'hide-sidebar' );

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-51438'; $wp_version = '5.9-alpha-51440';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.