aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static/js/resources
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/static/js/resources')
-rw-r--r--pydis_site/static/js/resources/resources.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js
index bffb5e91..00bc6ad8 100644
--- a/pydis_site/static/js/resources/resources.js
+++ b/pydis_site/static/js/resources/resources.js
@@ -234,11 +234,12 @@ document.addEventListener("DOMContentLoaded", function () {
if (screen.width < 480) {
let categoryHeaders = $(".filter-category-header .collapsible-content");
let icons = $('.filter-category-header button .card-header-icon i');
- categoryHeaders.addClass("no-transition");
- categoryHeaders.css("max-height", "");
+ categoryHeaders.addClass("no-transition collapsed");
icons.removeClass(["far", "fa-window-minimize"]);
icons.addClass(["fas", "fa-angle-down"]);
- categoryHeaders.removeClass("no-transition");
+
+ // Wait 10ms before removing this class, or else the transition will animate due to a race condition.
+ setTimeout(() => { categoryHeaders.removeClass("no-transition"); }, 10);
}
// If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox.