Show a reset button if any facets are in use

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
(function($) {

$(document).on(‘facetwp-loaded’, function() {
var in_use = false;

// see if any facets are in use
$.each(FWP.facets, function(name, val) {
if (val.length > 0) {
in_use = true;
}
}

// true = show, false = hide
$(‘.facetwp-reset-btn’).toggle(in_use);
});

})(jQuery);
{{/gist}}