FacetWP – ignore URL hash except when resetting

<script>
(function($) {
    $(document).on('facetwp-refresh', function() {
        if (! FWP.loaded) {
            FWP.temp_set_hash = FWP.set_hash; // on init, save a backup of FWP.set_hash()
        }
        if (FWP.is_reset) {
            FWP.set_hash = FWP.temp_set_hash; // on reset, store FWP.set_hash()
        }
        else {
            FWP.set_hash = function() { /* empty */ } // otherwise, empty it
        }
    });
})(jQuery);
</script>