Ticket #19815: 19815.12.2.diff
File 19815.12.2.diff, 1.8 KB (added by , 13 years ago) |
---|
-
wp-admin/js/theme.dev.js
68 68 var ThemeScroller; 69 69 (function($){ 70 70 ThemeScroller = { 71 nonce: '',72 nextPage: 2, // By default, assume we're on the first page.73 71 querying: false, 74 72 scrollPollingDelay: 500, 75 73 failedRetryDelay: 4000, … … 82 80 * @access private 83 81 */ 84 82 init: function() { 85 var self = this, 86 startPage; 83 var self = this; 87 84 88 85 // Get out early if we don't have the required arguments. 89 86 if ( typeof ajaxurl === 'undefined' || … … 95 92 96 93 // Handle inputs 97 94 this.nonce = $('#_ajax_fetch_list_nonce').val(); 95 this.nextPage = ( theme_list_args.paged + 1 ); 98 96 99 startPage = theme_list_args.paged;100 if ( startPage !== undefined )101 this.nextPage = ( startPage + 1 );102 103 97 // Cache jQuery selectors 104 98 this.$outList = $('#availablethemes'); 105 99 this.$spinner = $('div.tablenav.bottom').children( 'img.ajax-loading' ); … … 110 104 * If there are more pages to query, then start polling to track 111 105 * when user hits the bottom of the current page 112 106 */ 113 if ( theme_list_args.total_pages !== undefined && 114 theme_list_args.total_pages >= this.nextPage ) 107 if ( theme_list_args.total_pages >= this.nextPage ) 115 108 this.pollInterval = 116 109 setInterval( function() { 117 110 return self.poll(); … … 144 137 * @param results Array with results from this.ajax() query. 145 138 */ 146 139 process: function( results ) { 147 if ( ( results === undefined ) || 148 ( results.rows === undefined ) || 149 ( results.rows.indexOf( 'no-items' ) != -1 ) ) { 140 if ( results === undefined ) { 150 141 clearInterval( this.pollInterval ); 151 142 return; 152 143 }