Making WordPress.org

Changeset 4678


Ignore:
Timestamp:
01/14/2017 02:05:34 AM (9 years ago)
Author:
coreymckrill
Message:

WordCamp Site Cloner: Fix infinite scrolling of site search results

The script was binding to the scroll event on the wrong element, so the
bound method was never firing. This changes the bind to the element that
actually has a scroll bar. It's possible that this problem was caused
by markup changes in the Customizer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-site-cloner/wordcamp-site-cloner.js

    r4280 r4678  
    4848
    4949            // Container that will be scrolled within
    50             this.$container = $( '#wcsc-cloner' ).parents( 'ul.accordion-section-content' );
     50            this.$container = $( '#wcsc-cloner' ).parents( '.wp-full-overlay-sidebar-content' );
    5151            // Bind scrolling within the container to check for infinite scroll
    5252            this.$container.bind( 'scroll', _.throttle( this.scroller, 300 ) );
     
    159159
    160160        paginate : function( pageIndex ) {
    161             var collection = this;
     161            var collection = this,
     162                perPage    = 20;
    162163
    163164            pageIndex  = pageIndex || 0;
    164165
    165             collection = _( collection.rest( 20 * pageIndex ) );
    166             collection = _( collection.first( 20 ) );
     166            collection = _( collection.rest( perPage * pageIndex ) );
     167            collection = _( collection.first( perPage ) );
    167168
    168169            return collection;
Note: See TracChangeset for help on using the changeset viewer.