(function($) {
$(document).on('facetwp-loaded', function() {
$.each(FWP.facets, function(name, vals) {
if (FWP.facets[name].length > 0) {
$('.facetwp-facet-' + name).addClass('is-active');
}
else {
$('.facetwp-facet-' + name).removeClass('is-active');
}
});
});
})(jQuery);