Ticket #27055: 27055.36.diff
File 27055.36.diff, 1.9 KB (added by , 10 years ago) |
---|
-
wp-admin/js/theme.js
494 494 495 495 // If we have no more themes, bail. 496 496 if ( _.isUndefined( self.current ) ) { 497 self.options.parent.parent.trigger( 'theme:end' ); 497 498 return self.current = current; 498 499 } 499 500 … … 505 506 // Render and append. 506 507 preview.render(); 507 508 $( 'div.wrap' ).append( preview.el ); 509 $( '.next-theme' ).focus(); 508 510 }) 509 511 .listenTo( preview, 'theme:previous', function() { 510 512 … … 532 534 // Render and append. 533 535 preview.render(); 534 536 $( 'div.wrap' ).append( preview.el ); 537 $( '.previous-theme' ).focus(); 535 538 }); 536 539 } 537 540 }); … … 882 885 // Loop through the themes and setup each theme view 883 886 self.instance.each( function( theme ) { 884 887 self.theme = new themes.view.Theme({ 885 model: theme 888 model: theme, 889 parent: self 886 890 }); 887 891 888 892 // Render the views... … … 1224 1228 // Get the themes by sending Ajax POST request to api.wordpress.org/themes 1225 1229 // or searching the local cache 1226 1230 this.collection.query( request ); 1231 1232 // Set route 1233 themes.router.navigate( themes.router.baseUrl( '?search=' + value ), { replace: true } ); 1227 1234 }, 300 ) 1228 1235 }); 1229 1236 … … 1329 1336 }, 1330 1337 1331 1338 sort: function( sort ) { 1332 $( '#theme-search-input' ).val( '');1339 this.clearSearch(); 1333 1340 1334 1341 $( '.theme-section, .theme-filter' ).removeClass( this.activeClass ); 1335 1342 $( '[data-sort="' + sort + '"]' ).addClass( this.activeClass ); … … 1450 1457 return this.addFilter(); 1451 1458 } 1452 1459 1460 this.clearSearch(); 1461 1462 themes.router.navigate( themes.router.baseUrl( '' ) ); 1453 1463 $( 'body' ).toggleClass( 'more-filters-opened' ); 1454 1464 }, 1455 1465 … … 1474 1484 1475 1485 backToFilters: function() { 1476 1486 $( 'body' ).removeClass( 'filters-applied' ); 1487 }, 1488 1489 clearSearch: function() { 1490 $( '#theme-search-input').val( '' ); 1477 1491 } 1478 1492 }); 1479 1493