Skip to:
Content

BuddyPress.org

Ticket #5546: 5546.diff

File 5546.diff, 807 bytes (added by needle, 12 years ago)

Prevent Load More from firing multiple times

  • bp-templates/bp-legacy/js/buddypress.js

     
    378378
    379379                /* Load more updates at the end of the page */
    380380                if ( target.parent().hasClass('load-more') ) {
     381                        if ( bp_ajax_request ) {
     382                                bp_ajax_request.abort();
     383                        }
     384
    381385                        jq("#buddypress li.load-more").addClass('loading');
    382386
    383387                        if ( null == jq.cookie('bp-activity-oldestpage') )
     
    393397                                just_posted.push( jq(this).attr('id').replace( 'activity-','' ) );
    394398                        });
    395399
    396                         jq.post( ajaxurl, {
     400                        bp_ajax_request = jq.post( ajaxurl, {
    397401                                action: 'activity_get_older_updates',
    398402                                'cookie': bp_get_cookies(),
    399403                                'page': oldest_page,