Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save badabingbreda/0098a652ae1cbf0929c58e3a228961b7 to your computer and use it in GitHub Desktop.
Save badabingbreda/0098a652ae1cbf0929c58e3a228961b7 to your computer and use it in GitHub Desktop.
Toolbox Example: Dynamic Group Filter JS
jQuery( '.chooser' ).on( 'click' , function( event ) {
var $this = jQuery(this);
var term = $this.data('term');
if ( $this.hasClass( 'uk-button-primary' ) ) {
var $unterm = jQuery( '.shadow[data-term="' + term + '"]' );
UIkit.filter('[uk-filter="target: .js-filter"]', { target: ".js-filter" } ).apply( $unterm );
} else {
UIkit.filter('[uk-filter="target: .js-filter"]', { target: ".js-filter" } ).apply( $this );
}
$this.toggleClass('uk-button-primary');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment