Skip to content

Commit

Permalink
Merge pull request #14444 from britneywwc/engage-filters
Browse files Browse the repository at this point in the history
Disable multiple fields filtering on engage pages
  • Loading branch information
britneywwc authored Oct 23, 2024
2 parents 98ae343 + b0e9d50 commit aabce78
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions templates/engage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ <h3>No results &mdash; why not try widening your search?</h3>
clearFiltersButton.removeAttribute("disabled");
}

// Disable other fields if a filter is already applied
const searchParams = new URLSearchParams(urlObj.search);
for (const [key, value] of searchParams) {
if (key === "language") {
resourceSelector.setAttribute("disabled", true);
tagSelector.setAttribute("disabled", true);
} else if (key === "resource") {
languageSelector.setAttribute("disabled", true);
tagSelector.setAttribute("disabled", true);
} else if (key === "tag") {
languageSelector.setAttribute("disabled", true);
resourceSelector.setAttribute("disabled", true);
}
}

function handleFilter(key, el, url) {
if (!el) {
return;
Expand Down

0 comments on commit aabce78

Please sign in to comment.