diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index e69993f04f..0051bef32c 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -4903,13 +4903,14 @@ scroll: function() { var view = this, - toolbar = this.views.parent.toolbar; + toolbar; - // @todo: is :visible still necessary? if ( ! this.$el.is(':visible') || ! this.collection.hasMore() ) { return; } + toolbar = this.views.parent.toolbar; + // Show the spinner only if we are close to the bottom. if ( this.el.scrollHeight - ( this.el.scrollTop + this.el.clientHeight ) < this.el.clientHeight / 3 ) { toolbar.get('spinner').show();