aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-02-13 10:26:51 +0100
committerGravatar Leon Sandøy <[email protected]>2022-02-13 10:26:51 +0100
commit364060841c39c12973e6edd1854d251d5d8011c9 (patch)
tree4f51ae95f89838b3ea0993d8ca8d79144038135b /pydis_site/static
parentDynamically update URL with search query. (diff)
Trigger a UI update when typing into search.
Diffstat (limited to 'pydis_site/static')
-rw-r--r--pydis_site/static/js/resources/resources.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js
index c4d01f9d..348571e6 100644
--- a/pydis_site/static/js/resources/resources.js
+++ b/pydis_site/static/js/resources/resources.js
@@ -246,6 +246,11 @@ document.addEventListener("DOMContentLoaded", function () {
setTimeout(() => { categoryHeaders.removeClass("no-transition"); }, 10);
}
+ // When you type into the search bar, trigger an UI update.
+ $("#resource-search input").on("input", function() {
+ updateUI();
+ });
+
// If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox.
$('.filter-panel').on("click",function(event) {
let hitsCheckbox = Boolean(String(event.target));