Changeset 1247
- Timestamp:
- 02/10/2015 09:23:38 PM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php
r1242 r1247 37 37 <div class="filter-drawer"> 38 38 <div class="buttons"> 39 < a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a>40 < a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a>39 <button type="button" disabled="disabled" class="apply-filters button button-secondary"><?php _e( 'Apply Filters' ); ?><span></span></button> 40 <button type="button" class="clear-filters button button-secondary"><?php _e( 'Clear' ); ?></button> 41 41 </div> 42 42 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
r1241 r1247 54 54 55 55 $( 'body' ).toggleClass( 'show-filters' ); 56 } 56 }, 57 58 // Get the checked filters. 59 // @return {array} of tags or false. 60 filtersChecked: function() { 61 var items = $( '.filter-group' ).find( ':checkbox' ).filter( ':checked' ), 62 drawer = $( '.filter-drawer' ), 63 tags = []; 64 65 _.each( items, function( item ) { 66 tags.push( $( item ).prop( 'value' ) ); 67 }); 68 69 // When no filters are checked, restore initial state and return. 70 if ( 0 === tags.length ) { 71 drawer.find( '.apply-filters' ).prop( 'disabled', true ).find( 'span' ).text( '' ); 72 drawer.find( '.clear-filters' ).hide(); 73 $( 'body' ).removeClass( 'filters-applied' ); 74 return false; 75 } 76 77 drawer.find( '.apply-filters' ).prop( 'disabled', false ).find( 'span' ).text( tags.length ); 78 drawer.find( '.clear-filters' ).css( 'display', 'inline-block' ); 79 80 return tags; 81 }, 57 82 58 83 });
Note: See TracChangeset
for help on using the changeset viewer.