aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static/js/resources.js
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/static/js/resources.js')
-rw-r--r--pydis_site/static/js/resources.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/pydis_site/static/js/resources.js b/pydis_site/static/js/resources.js
index c9ce408b..89b8ae06 100644
--- a/pydis_site/static/js/resources.js
+++ b/pydis_site/static/js/resources.js
@@ -112,6 +112,8 @@ function updateUI() {
}
// Otherwise, hide everything and then filter the resources to decide what to show.
+ let hasMatches = false;
+ console.log(hasMatches);
resources.hide();
resources.filter(function() {
let validation = {
@@ -140,11 +142,20 @@ function updateUI() {
// If validation passes, show the resource.
if (Object.values(validation).every(Boolean)) {
+ hasMatches = true;
return true;
} else {
return false;
}
}).show();
+
+ // If there are no matches, show the no matches message
+ console.log(hasMatches);
+ if (!hasMatches) {
+ $(".no-resources-found").show();
+ } else {
+ $(".no-resources-found").hide();
+ }
}
// Executed when the page has finished loading.