From 110e0c774e9950436dacbee1bbae1e74c37400fa Mon Sep 17 00:00:00 2001 From: Florian CHOMETON Date: Fri, 15 Apr 2022 09:37:42 +0200 Subject: [PATCH] Add option to show/hide disabled accept button in mandatory --- README.md | 3 ++- tarteaucitron.js | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 460a419..4741ff9 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,8 @@ tarteaucitron.init({ "readmoreLink": "", /* Change the default readmore link pointing to tarteaucitron.io */ - "mandatory": true /* Show a message about mandatory cookies */ + "mandatory": true, /* Show a message about mandatory cookies */ + "mandatoryCta": true /* Show the disabled accept button when mandatory on */ }); ``` diff --git a/tarteaucitron.js b/tarteaucitron.js index 0f1bb75..495856f 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -220,6 +220,7 @@ var tarteaucitron = { "useExternalCss": false, "useExternalJs": false, "mandatory": true, + "mandatoryCta": true, "closePopup": false, "groupServices": false, "serviceDefaultState": 'wait', @@ -365,14 +366,16 @@ var tarteaucitron = { html += ' ' + tarteaucitron.lang.mandatoryText + ''; html += '
'; html += ' '; - html += '
'; - html += ' '; - html += ' '; - html += '
'; + if (tarteaucitron.parameters.mandatoryCta == true) { + html += '
'; + html += ' '; + html += ' '; + html += '
'; + } html += ''; html += ''; }