From d575667e5f3ebaae11b55b8b2ddaa2f430ee8e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Frankiewicz?= Date: Tue, 4 Jun 2024 15:11:53 +0200 Subject: [PATCH] fixes bar mode display mode responsiveness and missing wall after settings modal close --- src/app.js | 10 +++++++--- styles/light.css | 2 +- www/bar.html | 1 + www/modal.html | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app.js b/src/app.js index 652f447..6099a6a 100644 --- a/src/app.js +++ b/src/app.js @@ -75,14 +75,16 @@ function saveConsentState(consentState) { } // Components -function createMain(gtmCookiesConfig) { +function createMain(config) { var main = document.createElement("div"); main.setAttribute('id', 'consent-banner-main'); + main.setAttribute('data-mode', config.display.mode); + main.setAttribute('data-wall', config.display.wall ?? false); main.style.display = 'none'; return main; } -function createWall(gtmCookiesConfig) { +function createWall(config) { var wall = document.createElement("div"); wall.setAttribute('id', 'consent-banner-wall'); return wall; @@ -227,7 +229,9 @@ function showSettings(main) { function hideSettings(main) { main.style.display = 'block'; main.querySelector('#consent-banner-settings').style.display = 'none'; - hideWall(main) + if ('true' !== main.getAttribute('data-wall')) { + hideWall(main); + } } diff --git a/styles/light.css b/styles/light.css index fd80911..0ba937a 100644 --- a/styles/light.css +++ b/styles/light.css @@ -142,7 +142,7 @@ #consent-banner-settings > div > form div:nth-child(2) { max-height: none; } - #consent-banner-modal { + #consent-banner-main:not([data-mode="bar"]) #consent-banner-modal { width: auto; left: 5% !important; right: 5% !important; diff --git a/www/bar.html b/www/bar.html index e0f1b35..8307be2 100644 --- a/www/bar.html +++ b/www/bar.html @@ -1,6 +1,7 @@ +