Listable – homepage facet handler

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
(function($) {
$(function() {
if (0 < $(‘body.home’).length) {
FWP.loading_handler = function(params) { } // No loading spinner
}
});
})(jQuery);

// Button click handler
function facetwp_redirect_to_listings() {
FWP.parse_facets();
var query_string = FWP.build_query_string();
query_string = (” == query_string) ? ” : ‘?’ . query_string;
window.location.href = ‘{PATH_TO_LISTINGS_PAGE}’ + url;
}
{{/gist}}