diff options
author | 2022-02-13 14:12:53 +0100 | |
---|---|---|
committer | 2022-02-13 14:12:53 +0100 | |
commit | b4fc433e22ec7192ac5dbe43aa6f483574ac1726 (patch) | |
tree | df28b3b7d4b2dbdf4419087ad015c6a533a9c9e7 /pydis_site/static | |
parent | Search 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.js | 5 |
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(); |