Created
March 28, 2018 16:31
-
-
Save mgibbs189/f3b4fc68e042770a537215ccf39cb4a7 to your computer and use it in GitHub Desktop.
Manually replace sort box with fSelect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |
Author
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
@jackgregory that's a good suggestion, would make sense to make sure the fSelect has a parent
facetwp-facetelement before firing :)