search-widget.js 558 B

123456789101112131415
  1. jQuery( document ).ready( function() {
  2. var filter_list = jQuery( '.jetpack-search-filters-widget__filter-list' );
  3. filter_list.on( 'click', 'a', function() {
  4. var checkbox = jQuery( this ).siblings( 'input[type="checkbox"]' );
  5. checkbox.prop( 'checked', ! checkbox.prop( 'checked' ) );
  6. } );
  7. filter_list.find( 'input[type="checkbox"]' ).prop( 'disabled', false ).css( 'cursor', 'inherit' ).on( 'click', function() {
  8. var anchor = jQuery( this ).siblings( 'a' );
  9. if ( anchor.length ) {
  10. window.location.href = anchor.prop( 'href' );
  11. }
  12. } );
  13. } );