diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 1e10a1c9c5..0505774711 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -129,11 +129,10 @@ themes.Collection = Backbone.Collection.extend({ // Performs a search within the collection // @uses RegExp search: function( term ) { - var self = this, - match, results, haystack; + var match, results, haystack; // Start with a full collection - self.reset( themes.data.themes ); + this.reset( themes.data.themes, { silent: true } ); // The RegExp object to match // @@ -144,7 +143,7 @@ themes.Collection = Backbone.Collection.extend({ // Find results // _.filter and .test - results = self.filter( function( data ) { + results = this.filter( function( data ) { haystack = _.union( data.get( 'name' ), data.get( 'description' ), data.get( 'author' ), data.get( 'tags' ) ); if ( match.test( data.get( 'author' ) ) ) { @@ -154,7 +153,7 @@ themes.Collection = Backbone.Collection.extend({ return match.test( haystack ); }); - self.reset( results ); + this.reset( results ); }, // Paginates the collection with a helper method