Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.2 #19

Merged
merged 10 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}


Expand Down
2 changes: 1 addition & 1 deletion styles/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions www/bar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
Expand Down
1 change: 1 addition & 0 deletions www/modal.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
Expand Down