aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-02-01 01:18:57 +0100
committerGravatar Leon Sandøy <[email protected]>2022-02-01 01:18:57 +0100
commit4dfde7fbf09a38134e997abe5b2b7ebe08fc0538 (patch)
treebd3191c7d778b6bb9be605cad955b2540bb0d9f2 /pydis_site/static
parentAdd more tests for the new resources page. (diff)
Make resource tags correctly deactivate.
Diffstat (limited to 'pydis_site/static')
-rw-r--r--pydis_site/static/js/resources/resources.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js
index 8627a359..bffb5e91 100644
--- a/pydis_site/static/js/resources/resources.js
+++ b/pydis_site/static/js/resources/resources.js
@@ -115,6 +115,7 @@ function updateURL() {
function updateUI() {
let resources = $('.resource-box');
let filterTags = $('.filter-box-tag');
+ let resourceTags = $('.resource-tag');
let noTagsSelected = $(".no-tags-selected.tag");
let closeFiltersButton = $(".close-filters-button");
@@ -127,9 +128,17 @@ function updateUI() {
filterTags.hide();
noTagsSelected.show();
closeFiltersButton.hide();
+ resourceTags.removeClass("active");
$(`.filter-checkbox:checked`).prop("checked", false)
return;
} else {
+ // Hide everything
+ $('.filter-box-tag').hide();
+ $('.resource-tag').removeClass("active");
+ noTagsSelected.show();
+ closeFiltersButton.hide();
+
+ // Now conditionally show the stuff we want
$.each(activeFilters, function(filterType, filters) {
$.each(filters, function(index, filter) {
// Show a corresponding filter box tag