Add option to show/hide disabled accept button in mandatory

This commit is contained in:
Florian CHOMETON 2022-04-15 09:37:42 +02:00
parent f5b7b83ab0
commit 110e0c774e
2 changed files with 13 additions and 9 deletions

View File

@ -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 */
});
</script>
```

View File

@ -220,6 +220,7 @@ var tarteaucitron = {
"useExternalCss": false,
"useExternalJs": false,
"mandatory": true,
"mandatoryCta": true,
"closePopup": false,
"groupServices": false,
"serviceDefaultState": 'wait',
@ -365,6 +366,7 @@ var tarteaucitron = {
html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>';
html += ' <span class="tarteaucitronListCookies" aria-hidden="true"></span><br/>';
html += ' </div>';
if (tarteaucitron.parameters.mandatoryCta == true) {
html += ' <div class="tarteaucitronAsk">';
html += ' <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>';
html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
@ -373,6 +375,7 @@ var tarteaucitron = {
html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
html += ' </button> ';
html += ' </div>';
}
html += '</li>';
html += '</ul></li>';
}