Open the cookie manager with a class name on a link

Bonne idée 👍 https://github.com/AmauriC/tarteaucitron.js/issues/59

Pour faciliter les choses, c'est possible en ajoutant une class à un lien :
`<a href="https://www.monsite.fr/mapage_cookie/" class="tarteaucitronOpenPanel">Cookies</a>`
This commit is contained in:
Amauri CHAMPEAUX 2018-04-13 09:08:24 +02:00 committed by GitHub
parent 813e036f0f
commit 94319d0646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -33,8 +33,9 @@ var tarteaucitron = {
window.addEventListener("load", function () {
tarteaucitron.load();
tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
elem.addEventListener("click", function () {
elem.addEventListener("click", function (event) {
tarteaucitron.userInterface.openPanel();
event.preventDefault();
}, false);
}, true);
}, false);
@ -87,8 +88,9 @@ var tarteaucitron = {
window.attachEvent("onload", function () {
tarteaucitron.load();
tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
elem.attachEvent("onclick", function () {
elem.attachEvent("onclick", function (event) {
tarteaucitron.userInterface.openPanel();
event.preventDefault();
});
}, true);
});