Created
October 18, 2023 10:05
-
-
Save JuliaKiselyova/792b4c4f11b092f7c4786ac1d0cee6f1 to your computer and use it in GitHub Desktop.
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
| let activeTaxonomies = {}; | |
| document.addEventListener('jet-smart-filters/inited', function (initEvent) { | |
| const filterGroups = JetSmartFilters.filterGroups; | |
| JetSmartFilters.events.subscribe('fiter/change', function (clickedFilter) { | |
| const filterInfo = clickedFilter.additionalFilterSettings; | |
| const queryVar = filterInfo && filterInfo.filter.queryVar; | |
| console.log('Filter Info:', filterInfo); | |
| console.log('Query Var:', queryVar); | |
| if (queryVar) { | |
| if (activeTaxonomies[queryVar]) { | |
| if (activeTaxonomies[queryVar] !== clickedFilter) { | |
| activeTaxonomies[queryVar].reset(); | |
| } | |
| } | |
| activeTaxonomies[queryVar] = clickedFilter; | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment