diff --git src/wp-admin/js/theme.js src/wp-admin/js/theme.js
index 0f35f9fa36..af8f1b360a 100644
|
|
|
themes.view.Appearance = wp.Backbone.View.extend({ |
| 102 | 102 | collection: self.collection, |
| 103 | 103 | parent: this |
| 104 | 104 | }); |
| | 105 | self.searchView = view; |
| 105 | 106 | |
| 106 | 107 | // Render and append after screen title |
| 107 | 108 | view.render(); |
| … |
… |
themes.view.Search = wp.Backbone.View.extend({ |
| 1347 | 1348 | event.target.value = ''; |
| 1348 | 1349 | } |
| 1349 | 1350 | |
| 1350 | | // Note that doSearch is throttled. |
| | 1351 | // Since doSearch is debounced, it will only run when user input comes to a rest. |
| 1351 | 1352 | this.doSearch( event ); |
| 1352 | 1353 | }, |
| 1353 | 1354 | |
| 1354 | 1355 | // Runs a search on the theme collection. |
| 1355 | | doSearch: _.throttle( function( event ) { |
| | 1356 | doSearch: function( event ) { |
| 1356 | 1357 | var options = {}; |
| 1357 | 1358 | |
| 1358 | 1359 | this.collection.doSearch( event.target.value.replace( /\+/g, ' ' ) ); |
| … |
… |
themes.view.Search = wp.Backbone.View.extend({ |
| 1370 | 1371 | } else { |
| 1371 | 1372 | themes.router.navigate( themes.router.baseUrl( '' ) ); |
| 1372 | 1373 | } |
| 1373 | | }, 500 ), |
| | 1374 | }, |
| 1374 | 1375 | |
| 1375 | 1376 | pushState: function( event ) { |
| 1376 | 1377 | var url = themes.router.baseUrl( '' ); |
| … |
… |
themes.Run = { |
| 1461 | 1462 | pushState: true, |
| 1462 | 1463 | hashChange: false |
| 1463 | 1464 | }); |
| | 1465 | |
| | 1466 | // Start debouncing user searches. |
| | 1467 | this.view.searchView.doSearch = _.debounce( this.view.searchView.doSearch, 500 ); |
| 1464 | 1468 | }, |
| 1465 | 1469 | |
| 1466 | 1470 | routes: function() { |
| … |
… |
themes.view.InstallerSearch = themes.view.Search.extend({ |
| 1520 | 1524 | this.doSearch( event.target.value ); |
| 1521 | 1525 | }, |
| 1522 | 1526 | |
| 1523 | | doSearch: _.throttle( function( value ) { |
| | 1527 | doSearch: function( value ) { |
| 1524 | 1528 | var request = {}; |
| 1525 | 1529 | |
| 1526 | 1530 | // Don't do anything if the search terms haven't changed. |
| … |
… |
themes.view.InstallerSearch = themes.view.Search.extend({ |
| 1564 | 1568 | |
| 1565 | 1569 | // Set route |
| 1566 | 1570 | themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + encodeURIComponent( value ) ), { replace: true } ); |
| 1567 | | }, 500 ) |
| | 1571 | } |
| 1568 | 1572 | }); |
| 1569 | 1573 | |
| 1570 | 1574 | themes.view.Installer = themes.view.Appearance.extend({ |
| … |
… |
themes.RunInstaller = { |
| 1935 | 1939 | pushState: true, |
| 1936 | 1940 | hashChange: false |
| 1937 | 1941 | }); |
| | 1942 | |
| | 1943 | // Start debouncing user searches. |
| | 1944 | this.view.searchView.doSearch = _.debounce( this.view.searchView.doSearch, 500 ); |
| 1938 | 1945 | }, |
| 1939 | 1946 | |
| 1940 | 1947 | routes: function() { |