Changeset 1241
- Timestamp:
- 02/10/2015 05:56:28 PM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php
r1235 r1241 64 64 65 65 <div class="theme-browser content-filterable"> 66 <div class="themes" style="display: none;">66 <div class="themes"> 67 67 <?php 68 68 if ( ! is_wp_error( $themes ) ) : -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
r1240 r1241 8 8 9 9 _.extend( wp.themes.view.Installer.prototype, { 10 el: '#themes' 10 el: '#themes', 11 12 // Applying filters triggers a tag request. 13 applyFilters: function( event ) { 14 var name, 15 tags = this.filtersChecked(), 16 request = { tag: tags }, 17 filteringBy = $( '.filtered-by .tags' ); 18 19 if ( event ) { 20 event.preventDefault(); 21 } 22 23 $( 'body' ).addClass( 'filters-applied' ); 24 $( '.filter-links li > a.current' ).removeClass( 'current' ); 25 filteringBy.empty(); 26 27 _.each( tags, function( tag ) { 28 name = $( 'label[for="filter-id-' + tag + '"]' ).text(); 29 filteringBy.append( '<span class="tag">' + name + '</span>' ); 30 }); 31 32 wp.themes.router.navigate( wp.themes.router.baseUrl( 'tag/' + tags.join( '+' ) ), { replace: true } ); 33 34 // Get the themes by sending Ajax POST request to api.wordpress.org/themes 35 // or searching the local cache 36 this.collection.query( request ); 37 }, 38 39 // Toggle the full filters navigation. 40 moreFilters: function( event ) { 41 event.preventDefault(); 42 43 if ( $( 'body' ).hasClass( 'filters-applied' ) ) { 44 return this.backToFilters(); 45 } 46 47 // If the filters section is opened and filters are checked 48 // run the relevant query collapsing to filtered-by state 49 if ( $( 'body' ).hasClass( 'show-filters' ) && this.filtersChecked() ) { 50 return this.addFilter(); 51 } 52 53 this.clearSearch(); 54 55 $( 'body' ).toggleClass( 'show-filters' ); 56 } 57 11 58 }); 12 59 … … 402 449 403 450 wp.themes.router.on( 'route:tag', function( tag ) { 404 $( '#filter-id-' + tag).prop( 'checked', true ); 451 _.each( tag.split( '+' ), function( tag ) { 452 $( '#filter-id-' + tag ).prop( 'checked', true ); 453 }); 454 $( 'body' ).toggleClass( 'show-filters' ); 405 455 self.view.applyFilters(); 406 456 }); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css
r1236 r1241 606 606 .wp-filter .button.clear-filters { 607 607 display: none; 608 margin: 0 0 20px10px;608 margin: 0 0 0 10px; 609 609 } 610 610
Note: See TracChangeset
for help on using the changeset viewer.