aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-02-13 14:12:53 +0100
committerGravatar Leon Sandøy <[email protected]>2022-02-13 14:12:53 +0100
commitb4fc433e22ec7192ac5dbe43aa6f483574ac1726 (patch)
treedf28b3b7d4b2dbdf4419087ad015c6a533a9c9e7 /pydis_site/static
parentSearch the resource description too. (diff)
Fix duck pond not showing for search results of 0.
Diffstat (limited to 'pydis_site/static')
-rw-r--r--pydis_site/static/js/resources/resources.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js
index bbf07c94..b74c28ec 100644
--- a/pydis_site/static/js/resources/resources.js
+++ b/pydis_site/static/js/resources/resources.js
@@ -220,7 +220,6 @@ function updateUI() {
}
// Otherwise, hide everything and then filter the resources to decide what to show.
- let hasMatches = false;
resources.hide();
let filteredResources = resources.filter(function() {
let validation = {
@@ -249,7 +248,6 @@ function updateUI() {
// If validation passes, show the resource.
if (Object.values(validation).every(Boolean)) {
- hasMatches = true;
return true;
} else {
return false;
@@ -265,7 +263,8 @@ function updateUI() {
}
// If there are no matches, show the no matches message
- if (!hasMatches) {
+ let visibleResources = Boolean($(".resource-box:visible").length);
+ if (!visibleResources) {
$(".no-resources-found").show();
} else {
$(".no-resources-found").hide();