From 0b8da4d9f15f5f596512aa71365cd7e959846a87 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 13 Feb 2022 14:17:25 +0100 Subject: Make the remove all tags affect search, too. --- pydis_site/static/js/resources/resources.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pydis_site/static/js/resources/resources.js') 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(); -- cgit v1.2.3