FacetWP – custom sort event handler

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<script>
(function($) {
$(document).off(‘change’, ‘.facetwp-sort-select’); // unregister
$(document).on(‘change’, ‘.facetwp-sort-select’, function() { // register
FWP.extras.sort = $(this).val();
//FWP.soft_refresh = true; // remove soft_refresh
FWP.autoload();
});
})(jQuery);
</script>
{{/gist}}