diff options
author | 2022-02-13 14:17:25 +0100 | |
---|---|---|
committer | 2022-02-13 14:17:25 +0100 | |
commit | 0b8da4d9f15f5f596512aa71365cd7e959846a87 (patch) | |
tree | fa0c0c5ba492b3f28f9fe6e42ff50709ebb9a924 /pydis_site/static | |
parent | Fix duck pond not showing for search results of 0. (diff) |
Make the remove all tags affect search, too.
Diffstat (limited to 'pydis_site/static')
-rw-r--r-- | pydis_site/static/js/resources/resources.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index b74c28ec..113ce502 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -32,6 +32,7 @@ function removeAllFilters() { "payment-tiers": [], difficulty: [] }; + $("#resource-search input").val(""); updateUI(); } @@ -62,6 +63,7 @@ function deserializeURLParams() { if (searchParams.has("search")) { let searchQuery = searchParams.get("search"); $("#resource-search input").val(searchQuery); + $(".close-filters-button").show(); } // Work through the parameters and add them to the filter object @@ -143,6 +145,7 @@ function filterBySearch(resourceItems) { let tagText = $(".tag.search-query span"); tagText.text(`Search: ${searchQuery}`); tag.show(); + $(".close-filters-button").show(); } resourceItems.filter(function() { @@ -184,11 +187,11 @@ function updateUI() { } else { resources.show(); noTagsSelected.show(); + closeFiltersButton.hide(); $(".tag.search-query").hide(); } filterTags.hide(); - closeFiltersButton.hide(); resourceTags.removeClass("active"); $(`.filter-checkbox:checked`).prop("checked", false); $(".no-resources-found").hide(); |