facetwp auto click link when only one result

djrmom

{{gist file=”facet.js” lang=”javascript”}}
(function($) {
$(document).on(‘facetwp-loaded’, function() {
if (1 === FWP.settings.pager.total_rows ) {
$(‘.facetwp-template a:first’)[0].click();
}
});
})(jQuery);
{{/gist}}