Add clearcookieconsent link/button option.
This commit is contained in:
parent
31f67a58b0
commit
cf0c43760c
1 changed files with 23 additions and 2 deletions
|
|
@ -29,4 +29,16 @@
|
|||
});
|
||||
});
|
||||
|
||||
const clear_buttons = document.querySelectorAll('.clearcookieconsent');
|
||||
clear_buttons.forEach(function (button) {
|
||||
button.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (cookiebanner && cookieconsent) {
|
||||
localStorage.removeItem('cookieconsent');
|
||||
cookiebanner.classList.remove('hidden');
|
||||
cookiebanner.classList.add('js-cookieconsent-open');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue