WordPress.org

Make WordPress Core

Ticket #42348: 42348.diff

File 42348.diff, 877 bytes (added by afercia, 4 years ago)
  • src/wp-admin/js/theme.js

     
    13471347                        event.target.value = '';
    13481348                }
    13491349
    1350                 // Note that doSearch is throttled.
     1350                // Since doSearch is debounced, it will only run when user input comes to a rest.
    13511351                this.doSearch( event );
    13521352        },
    13531353
    13541354        // Runs a search on the theme collection.
    1355         doSearch: _.throttle( function( event ) {
     1355        doSearch: _.debounce( function( event ) {
    13561356                var options = {};
    13571357
    13581358                this.collection.doSearch( event.target.value.replace( /\+/g, ' ' ) );
     
    15201520                this.doSearch( event.target.value );
    15211521        },
    15221522
    1523         doSearch: _.throttle( function( value ) {
     1523        doSearch: _.debounce( function( value ) {
    15241524                var request = {};
    15251525
    15261526                // Don't do anything if the search terms haven't changed.