FacetWP – give the facet a class name if any of its choices are checked

mgibbs189

{{gist file=”front.js” lang=”javascript”}}
(function($) {
$(document).on(‘facetwp-loaded’, function() {
var facet_name = ‘YOUR_FACET_NAME’;
var in_use = FWP.facets[facet_name].length ? true : false;
$(‘.facetwp-facet-‘ + facet_name).toggleClass(‘has-checked’, in_use);
});
})(jQuery);

{{/gist}}