diff options
Diffstat (limited to 'plugins/jetpack/modules/widgets/search/js/search-widget.js')
-rw-r--r-- | plugins/jetpack/modules/widgets/search/js/search-widget.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/widgets/search/js/search-widget.js b/plugins/jetpack/modules/widgets/search/js/search-widget.js new file mode 100644 index 00000000..8d1c4775 --- /dev/null +++ b/plugins/jetpack/modules/widgets/search/js/search-widget.js @@ -0,0 +1,15 @@ +jQuery( document ).ready( function() { + var filter_list = jQuery( '.jetpack-search-filters-widget__filter-list' ); + + filter_list.on( 'click', 'a', function() { + var checkbox = jQuery( this ).siblings( 'input[type="checkbox"]' ); + checkbox.prop( 'checked', ! checkbox.prop( 'checked' ) ); + } ); + + filter_list.find( 'input[type="checkbox"]' ).prop( 'disabled', false ).css( 'cursor', 'inherit' ).on( 'click', function() { + var anchor = jQuery( this ).siblings( 'a' ); + if ( anchor.length ) { + window.location.href = anchor.prop( 'href' ); + } + } ); +} ); |