WordPress.org

Make WordPress Core

Ticket #36848: 36848.patch

File 36848.patch, 1.2 KB (added by afercia, 4 years ago)
  • src/wp-admin/js/theme.js

     
    979979                this.liveThemeCount = this.collection.count ? this.collection.count : this.collection.length;
    980980                this.count.text( this.liveThemeCount );
    981981
    982                 this.announceSearchResults( this.liveThemeCount );
     982                /*
     983                 * In the Theme Installer the Themes count is already announced
     984                 * because `announceSearchResults` is called on `query:success`.
     985                 */
     986                if ( ! themes.isInstall ) {
     987                        this.announceSearchResults( this.liveThemeCount );
     988                }
    983989        },
    984990
    985991        // Iterates through each instance of the collection
     
    13191325                'keyup': 'search'
    13201326        },
    13211327
     1328        searchTerms: '',
     1329
    13221330        // Handles Ajax request for searching through themes in public repo
    13231331        search: function( event ) {
    13241332
     
    13401348        doSearch: _.debounce( function( value ) {
    13411349                var request = {};
    13421350
     1351                // Don't do anything if the search terms haven't changed.
     1352                if ( this.searchTerms === value ) {
     1353                        return;
     1354                }
     1355
     1356                // Updates searchTerms with the current search terms.
     1357                this.searchTerms = value;
     1358
    13431359                request.search = value;
    13441360
    13451361                // Intercept an [author] search.