Ticket #34350: 34350.10.diff
| File 34350.10.diff, 2.1 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/js/theme.js
158 158 $( 'body' ).removeClass( 'no-results' ); 159 159 } 160 160 161 // Trigger a n 'update' event162 this.trigger( ' update' );161 // Trigger a 'themes:update' event 162 this.trigger( 'themes:update' ); 163 163 }, 164 164 165 165 // Performs a search within the collection … … 185 185 description = data.get( 'description' ).replace( /(<([^>]+)>)/ig, '' ); 186 186 author = data.get( 'author' ).replace( /(<([^>]+)>)/ig, '' ); 187 187 188 haystack = _.union( name, data.get( 'id' ), description, author, data.get( 'tags' ));188 haystack = _.union( [ name, data.get( 'id' ), description, author, data.get( 'tags' ) ] ); 189 189 190 190 if ( match.test( data.get( 'author' ) ) && term.length > 2 ) { 191 191 data.set( 'displayAuthor', true ); … … 264 264 265 265 // Trigger a collection refresh event 266 266 // and a `query:success` event with a `count` argument. 267 self.trigger( ' update' );267 self.trigger( 'themes:update' ); 268 268 self.trigger( 'query:success', count ); 269 269 270 270 if ( data.themes && data.themes.length === 0 ) { … … 308 308 this.count = this.length; 309 309 } 310 310 311 this.trigger( ' update' );311 this.trigger( 'themes:update' ); 312 312 this.trigger( 'query:success', this.count ); 313 313 } 314 314 }, … … 863 863 self.currentTheme(); 864 864 865 865 // When the collection is updated by user input... 866 this.listenTo( self.collection, ' update', function() {866 this.listenTo( self.collection, 'themes:update', function() { 867 867 self.parent.page = 0; 868 868 self.currentTheme(); 869 869 self.render( this ); 870 } );870 } ); 871 871 872 872 // Update theme count to full result set when available. 873 873 this.listenTo( self.collection, 'query:success', function( count ) { … … 1478 1478 1479 1479 // Construct the filter request 1480 1480 // using the default values 1481 filter = _.union( filter, this.filtersChecked());1481 filter = _.union( [ filter, this.filtersChecked() ] ); 1482 1482 request = { tag: [ filter ] }; 1483 1483 1484 1484 // Get the themes by sending Ajax POST request to api.wordpress.org/themes