Make WordPress Core

Ticket #24859: 24859.16.diff

File 24859.16.diff, 1.1 KB (added by kovshenin, 11 years ago)
  • src/wp-includes/js/media-views.js

     
    48864886
    48874887                scroll: function() {
    48884888                        var view = this,
    4889                                 toolbar;
     4889                                toolbar = this.views.parent.toolbar;
    48904890
    4891                         // @todo: is this still necessary?
    4892                         if ( ! this.$el.is(':visible') ) {
     4891                        // @todo: is :visible still necessary?
     4892                        if ( ! this.$el.is(':visible') || ! this.collection.hasMore() ) {
    48934893                                return;
    48944894                        }
    48954895
    4896                         if ( this.collection.hasMore() && this.el.scrollHeight < this.el.scrollTop + ( this.el.clientHeight * this.options.refreshThreshold ) ) {
    4897                                 toolbar = this.views.parent.toolbar;
     4896                        // Show the spinner only if we are close to the bottom.
     4897                        if ( this.el.scrollHeight - ( this.el.scrollTop + this.el.clientHeight ) < this.el.clientHeight / 3 ) {
    48984898                                toolbar.get('spinner').show();
     4899                        }
    48994900
     4901                        if ( this.el.scrollHeight < this.el.scrollTop + ( this.el.clientHeight * this.options.refreshThreshold ) ) {
    49004902                                this.collection.more().done(function() {
    49014903                                        view.scroll();
    49024904                                        toolbar.get('spinner').hide();