diff options
author | 2022-01-31 18:07:34 +0100 | |
---|---|---|
committer | 2022-01-31 18:07:34 +0100 | |
commit | 1e62517558b7aebfac3043b3cc799f075de5f0b5 (patch) | |
tree | 213c442947139a993ad6105a9bb9c23b77a5f873 /pydis_site/static/js | |
parent | Get rid of invalid filters in the URL. (diff) |
Hide no filters selected in all cases.
Diffstat (limited to 'pydis_site/static/js')
-rw-r--r-- | pydis_site/static/js/resources/resources.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index ad26afd4..d24fbfca 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -69,6 +69,7 @@ function deserializeURLParams() { let paramFilterArray = paramFilterContent.split(","); // Update the corresponding filter UI, so it reflects the internal state. + let filterAdded = false; $(paramFilterArray).each(function(_, filter) { // Make sure the filter is valid before we do anything. if (String(filter) === "rickroll" && filterType === "type") { @@ -83,11 +84,17 @@ function deserializeURLParams() { filterTag.show(); resourceTags.addClass("active"); activeFilters[filterType].push(filter); + filterAdded = true; } }); // Ditch all the params from the URL, and recalculate the URL params updateURL(); + + // If we've added a filter, hide the no filters tag. + if (filterAdded) { + $(".no-tags-selected.tag").hide(); + } } }); } |