Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created March 28, 2018 16:31
Show Gist options
  • Save mgibbs189/f3b4fc68e042770a537215ccf39cb4a7 to your computer and use it in GitHub Desktop.
Save mgibbs189/f3b4fc68e042770a537215ccf39cb4a7 to your computer and use it in GitHub Desktop.
Manually replace sort box with fSelect
<link href="path/to/fSelect.css" rel="stylesheet" type="text/css">
<script src="path/to/fSelect.js">
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
$('.facetwp-sort-select').fSelect();
});
})(jQuery);
</script>
@mgibbs189
Copy link
Author

E.g.

    $(document).on('fs:closed', function(e, wrap) {
        var is_facet = $(wrap).closest('.facetwp-facet').length > 0;

        if (is_facet && ! wrap.classList.contains('multiple')) {
            FWP.autoload();
        }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment