From 63edf8c64fcc68329e51d7965b0bfc2df7e8393b Mon Sep 17 00:00:00 2001 From: Ryan Westfall Date: Sun, 28 Jun 2026 07:14:35 -0500 Subject: [PATCH] Fixing how the consent banner loads --- .../public/static/public/js/tianji-consent.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/company_site/public/static/public/js/tianji-consent.js b/company_site/public/static/public/js/tianji-consent.js index 067e4f5..ec708c6 100644 --- a/company_site/public/static/public/js/tianji-consent.js +++ b/company_site/public/static/public/js/tianji-consent.js @@ -28,17 +28,17 @@ } } - function hideBanner() { - var banner = document.getElementById('cookie-consent-banner'); - if (banner) { - banner.hidden = true; - } - } - function showBanner() { var banner = document.getElementById('cookie-consent-banner'); if (banner) { - banner.hidden = false; + banner.removeAttribute('hidden'); + } + } + + function hideBanner() { + var banner = document.getElementById('cookie-consent-banner'); + if (banner) { + banner.setAttribute('hidden', ''); } } @@ -140,7 +140,7 @@ }); }; - document.addEventListener('DOMContentLoaded', function () { + function initConsent() { bindBannerControls(); var consent = getConsent(); @@ -155,5 +155,7 @@ } showBanner(); - }); + } + + initConsent(); })();