Ticket #27055: 27055.19.diff
| File 27055.19.diff, 1.3 KB (added by , 12 years ago) |
|---|
-
wp-admin/js/theme.js
269 269 self.add( data.themes ); 270 270 self.trigger( 'query:success' ); 271 271 272 // We are done loading themes for now. 273 self.loadingThemes = false; 274 272 275 }).fail( function() { 273 276 self.trigger( 'query:fail' ); 274 277 }); … … 331 334 } 332 335 } 333 336 }); 334 } 337 }, 338 339 // Static status controller for when we are loading themes. 340 loadingThemes: false 335 341 }); 336 342 337 343 // This is the view that controls each theme item … … 1149 1155 1150 1156 // Bump `collection.currentQuery.page` and request more themes if we hit the end of the page. 1151 1157 this.listenTo( this, 'theme:end', function() { 1158 1159 // Make sure we are not already loading 1160 if ( self.collection.loadingThemes ) { 1161 return; 1162 } 1163 1164 // Set loadingThemes to true and bump page instance of currentQuery. 1165 self.collection.loadingThemes = true; 1152 1166 self.collection.currentQuery.page++; 1167 1168 // Use currentQuery.page to build the themes request. 1153 1169 _.extend( self.collection.currentQuery.request, { page: self.collection.currentQuery.page } ); 1154 1170 self.collection.query( self.collection.currentQuery.request ); 1155 1171 });