Make WordPress Core

Changeset 20242


Ignore:
Timestamp:
03/21/2012 08:17:47 PM (14 years ago)
Author:
nacin
Message:

Tidy up sanity checks in theme.dev.js. props DH-Shredder, fixes #19815.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/theme.dev.js

    r20140 r20242  
    106106(function($){
    107107        ThemeScroller = {
    108                 nonce: '',
    109                 nextPage: 2, // By default, assume we're on the first page.
    110108                querying: false,
    111109                scrollPollingDelay: 500,
     
    120118                 */
    121119                init: function() {
    122                         var self = this,
    123                                 startPage;
     120                        var self = this;
    124121
    125122                        // Get out early if we don't have the required arguments.
     
    133130                        // Handle inputs
    134131                        this.nonce = $('#_ajax_fetch_list_nonce').val();
    135 
    136                         startPage = theme_list_args.paged;
    137                         if ( startPage !== undefined )
    138                                 this.nextPage = ( startPage + 1 );
     132                        this.nextPage = ( theme_list_args.paged + 1 );
    139133
    140134                        // Cache jQuery selectors
     
    148142                         * when user hits the bottom of the current page
    149143                         */
    150                         if ( theme_list_args.total_pages !== undefined &&
    151                                  theme_list_args.total_pages >= this.nextPage )
     144                        if ( theme_list_args.total_pages >= this.nextPage )
    152145                                this.pollInterval =
    153146                                        setInterval( function() {
     
    182175                 */
    183176                process: function( results ) {
    184                         if ( ( results === undefined ) ||
    185                                  ( results.rows === undefined ) ||
    186                                  ( results.rows.indexOf( 'no-items' ) != -1 ) ) {
     177                        if ( results === undefined ) {
    187178                                clearInterval( this.pollInterval );
    188179                                return;
Note: See TracChangeset for help on using the changeset viewer.