Lint fixes.

This commit is contained in:
Fredrik Jonsson 2021-02-01 09:29:04 +01:00
commit aa3a5d3808
2 changed files with 44 additions and 44 deletions

View file

@ -5,7 +5,7 @@
if (typeof window.Cookies !== 'undefined') { if (typeof window.Cookies !== 'undefined') {
const cookieconsent = document.querySelector('.cookieconsent'); const cookieconsent = document.querySelector('.cookieconsent');
if (window.Cookies.get('cookieconsent') === undefined && cookieconsent) { if (typeof window.Cookies.get('cookieconsent') === 'undefined' && cookieconsent) {
cookieconsent.classList.add('js-cookieconsent-open'); cookieconsent.classList.add('js-cookieconsent-open');
} }
@ -24,14 +24,14 @@
cookie_buttons.forEach(function (button) { cookie_buttons.forEach(function (button) {
button.addEventListener('click', function () { button.addEventListener('click', function () {
if (button.getAttribute('data-consent') == 'true') { if (button.getAttribute('data-consent') === 'true') {
window.Cookies.set('cookieconsent', 'accept', cookie_options); window.Cookies.set('cookieconsent', 'accept', cookie_options);
} }
else { else {
window.Cookies.set('cookieconsent', 'decline', cookie_options); window.Cookies.set('cookieconsent', 'decline', cookie_options);
} }
cookieconsent.classList.remove('js-cookieconsent-open'); cookieconsent.classList.remove('js-cookieconsent-open');
}) });
}); });
} }