Created
August 5, 2020 16:40
-
-
Save mgibbs189/557dcb2ff155d3fe4286c64310c2a86e to your computer and use it in GitHub Desktop.
Show a reset button if any facets are in use
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
| (function($) { | |
| $(document).on('facetwp-loaded', function() { | |
| var in_use = false; | |
| // see if any facets are in use | |
| $.each(FWP.facets, function(name, val) { | |
| if (val.length > 0) { | |
| in_use = true; | |
| } | |
| } | |
| // true = show, false = hide | |
| $('.facetwp-reset-btn').toggle(in_use); | |
| }); | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment