Changeset 42029
- Timestamp:
- 10/27/2017 03:30:27 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/theme.js
r41797 r42029 103 103 parent: this 104 104 }); 105 self.searchView = view; 105 106 106 107 // Render and append after screen title … … 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 … … 1371 1372 themes.router.navigate( themes.router.baseUrl( '' ) ); 1372 1373 } 1373 }, 500 ),1374 }, 1374 1375 1375 1376 pushState: function( event ) { … … 1446 1447 1447 1448 this.render(); 1449 1450 // Start debouncing user searches after Backbone.history.start(). 1451 this.view.searchView.doSearch = _.debounce( this.view.searchView.doSearch, 500 ); 1448 1452 }, 1449 1453 … … 1521 1525 }, 1522 1526 1523 doSearch: _.throttle(function( value ) {1527 doSearch: function( value ) { 1524 1528 var request = {}; 1525 1529 … … 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 … … 1920 1924 this.render(); 1921 1925 1926 // Start debouncing user searches after Backbone.history.start(). 1927 this.view.searchView.doSearch = _.debounce( this.view.searchView.doSearch, 500 ); 1922 1928 }, 1923 1929
Note: See TracChangeset
for help on using the changeset viewer.