From 54f50d7074f4002534cf677624e080a9a9d9db6b Mon Sep 17 00:00:00 2001 From: MewenLeHo Date: Mon, 18 Oct 2021 16:07:36 +0200 Subject: [PATCH] fix(#831): checkboxes display when user accept or deny cookies --- site/assets/js/tac.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/site/assets/js/tac.js b/site/assets/js/tac.js index cd67dc2542..0b55eed6f4 100644 --- a/site/assets/js/tac.js +++ b/site/assets/js/tac.js @@ -48,10 +48,10 @@ "googletagmanager_added", function () { var ask = document.querySelector( - "#googletagmanagerLine .tarteaucitronAsk" + '#googletagmanagerLine .tarteaucitronAsk' ); var choiceEvent = - "tarteaucitron.userInterface.respond(document.getElementById('googletagmanagerAllowed'),document.getElementById('googletagmanagerAllowed').checked);"; + 'tarteaucitron.userInterface.respond(document.getElementById("googletagmanagerAllowed"),document.getElementById("googletagmanagerAllowed").checked);'; var toggle = document .createRange() .createContextualFragment( @@ -62,22 +62,22 @@ ask.innerHTML = ""; ask.append(toggle); - var allowConsentButton = document.querySelector(".tarteaucitronAllow"); - var denyConsentButton = document.querySelector(".tarteaucitronDeny"); - var checkboxes = document.querySelectorAll(".form-check-input"); + var allowConsentButton = document.querySelector('.tarteaucitronAllow') + var denyConsentButton = document.querySelector('.tarteaucitronDeny') + var checkboxes = document.querySelectorAll('.form-check-input') [allowConsentButton].forEach(function (button) { - button.addEventListener("click", function () { + button.addEventListener('click', function () { for (var i = 0; i < checkboxes.length; i++) { if (!checkboxes.checked) { checkboxes[i].checked = true; } } - }); + }) }); [denyConsentButton].forEach(function (button) { - button.addEventListener("click", function () { + button.addEventListener('click', function () { for (var i = 0; i < checkboxes.length; i++) { if (checkboxes.checked !== true) { checkboxes[i].checked = false;