Merge pull request #927 from fchom/accessibility/option_delete_btn_mandatory

Accessibility : Add option to show/hide disabled accept button in mandatory
This commit is contained in:
Amauri CHAMPEAUX 2022-04-15 14:13:24 +02:00 committed by GitHub
commit 9fde32c7e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,14 +366,16 @@ 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>';
html += ' <div class="tarteaucitronAsk">';
html += ' <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>';
html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
html += ' </button> ';
html += ' <button type="button" class="tarteaucitronDeny" style="visibility:hidden" tabindex="-1">';
html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
html += ' </button> ';
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;
html += ' </button> ';
html += ' <button type="button" class="tarteaucitronDeny" style="visibility:hidden" tabindex="-1">';
html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
html += ' </button> ';
html += ' </div>';
}
html += '</li>';
html += '</ul></li>';
}