From 1e62517558b7aebfac3043b3cc799f075de5f0b5 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 31 Jan 2022 18:07:34 +0100 Subject: Hide no filters selected in all cases. --- pydis_site/static/js/resources/resources.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pydis_site/static/js') 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(); + } } }); } -- cgit v1.2.3