From e78fae3512d6e8d01a8aa1b8a1e5152c498c5cfa Mon Sep 17 00:00:00 2001 From: Muratcan Yeldan Date: Wed, 23 Apr 2025 11:26:14 +0300 Subject: [PATCH 1/2] hide cookie banner when analytics pop up shown --- src/main/resources/static/js/pages/home.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/pages/home.js b/src/main/resources/static/js/pages/home.js index 7872374eb69..a0112a16ecd 100644 --- a/src/main/resources/static/js/pages/home.js +++ b/src/main/resources/static/js/pages/home.js @@ -4,6 +4,20 @@ document.addEventListener('DOMContentLoaded', function () { if (window.analyticsPromptBoolean) { const analyticsModal = new bootstrap.Modal(document.getElementById('analyticsModal')); analyticsModal.show(); + + function hideCookieConsent() { + const cookieConsentElement = + document.querySelector('#cc-main') + + if (cookieConsentElement) { + console.log("cookie hidden") + cookieConsentElement.style.display = "none"; + } else { + // If not found, retry after a short delay + setTimeout(hideCookieConsent, 200); + } + } + hideCookieConsent(); } }); /*]]>*/ @@ -112,7 +126,7 @@ function setAsDefault(value) { function adjustVisibleElements() { const container = document.querySelector('.recent-features'); - if(!container) return; + if(!container) return; const subElements = Array.from(container.children); let totalWidth = 0; From 985d94469ca9f5ad5257a6c35e97c2c84a4ddec9 Mon Sep 17 00:00:00 2001 From: Muratcan Yeldan Date: Wed, 23 Apr 2025 11:26:14 +0300 Subject: [PATCH 2/2] hide cookie banner when analytics pop up shown --- src/main/resources/static/js/pages/home.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/pages/home.js b/src/main/resources/static/js/pages/home.js index 7872374eb69..8b656b3a610 100644 --- a/src/main/resources/static/js/pages/home.js +++ b/src/main/resources/static/js/pages/home.js @@ -4,6 +4,19 @@ document.addEventListener('DOMContentLoaded', function () { if (window.analyticsPromptBoolean) { const analyticsModal = new bootstrap.Modal(document.getElementById('analyticsModal')); analyticsModal.show(); + + function hideCookieConsent() { + const cookieConsentElement = + document.querySelector('#cc-main') + + if (cookieConsentElement) { + cookieConsentElement.style.display = "none"; + } else { + // If not found, retry after a short delay + setTimeout(hideCookieConsent, 200); + } + } + hideCookieConsent(); } }); /*]]>*/ @@ -112,7 +125,7 @@ function setAsDefault(value) { function adjustVisibleElements() { const container = document.querySelector('.recent-features'); - if(!container) return; + if(!container) return; const subElements = Array.from(container.children); let totalWidth = 0;