Make WordPress Core

Changeset 26685


Ignore:
Timestamp:
12/05/2013 07:14:59 PM (11 years ago)
Author:
nacin
Message:

Themes: when initiating a search, avoid triggering a reset event when it's not necessary.

props matveb.
fixes #26434.

File:
1 edited

Legend:

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

    r26660 r26685  
    130130    // @uses RegExp
    131131    search: function( term ) {
    132         var self = this,
    133             match, results, haystack;
     132        var match, results, haystack;
    134133
    135134        // Start with a full collection
    136         self.reset( themes.data.themes );
     135        this.reset( themes.data.themes, { silent: true } );
    137136
    138137        // The RegExp object to match
     
    145144        // Find results
    146145        // _.filter and .test
    147         results = self.filter( function( data ) {
     146        results = this.filter( function( data ) {
    148147            haystack = _.union( data.get( 'name' ), data.get( 'description' ), data.get( 'author' ), data.get( 'tags' ) );
    149148
     
    155154        });
    156155
    157         self.reset( results );
     156        this.reset( results );
    158157    },
    159158
Note: See TracChangeset for help on using the changeset viewer.