Lint fixes.
This commit is contained in:
parent
141f2f7b6d
commit
aa3a5d3808
2 changed files with 44 additions and 44 deletions
|
|
@ -1,38 +1,38 @@
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
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');
|
||||||
}
|
|
||||||
|
|
||||||
const cookie_buttons = Array.prototype.slice.call(
|
|
||||||
document.querySelectorAll('button[data-consent]')
|
|
||||||
);
|
|
||||||
const sitedomain = window.location.hostname.split('.').slice(-2);
|
|
||||||
const cookiedomain = sitedomain.join('.');
|
|
||||||
let cookie_options = [];
|
|
||||||
cookie_options['domain'] = cookiedomain;
|
|
||||||
cookie_options['sameSite'] = 'strict';
|
|
||||||
cookie_options['expires'] = 365;
|
|
||||||
if (window.location.protocol === 'https:') {
|
|
||||||
cookie_options['secure'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
cookie_buttons.forEach(function (button) {
|
|
||||||
button.addEventListener('click', function () {
|
|
||||||
if (button.getAttribute('data-consent') == 'true') {
|
|
||||||
window.Cookies.set('cookieconsent', 'accept', cookie_options);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
window.Cookies.set('cookieconsent', 'decline', cookie_options);
|
|
||||||
}
|
|
||||||
cookieconsent.classList.remove('js-cookieconsent-open');
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cookie_buttons = Array.prototype.slice.call(
|
||||||
|
document.querySelectorAll('button[data-consent]')
|
||||||
|
);
|
||||||
|
const sitedomain = window.location.hostname.split('.').slice(-2);
|
||||||
|
const cookiedomain = sitedomain.join('.');
|
||||||
|
let cookie_options = [];
|
||||||
|
cookie_options['domain'] = cookiedomain;
|
||||||
|
cookie_options['sameSite'] = 'strict';
|
||||||
|
cookie_options['expires'] = 365;
|
||||||
|
if (window.location.protocol === 'https:') {
|
||||||
|
cookie_options['secure'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
cookie_buttons.forEach(function (button) {
|
||||||
|
button.addEventListener('click', function () {
|
||||||
|
if (button.getAttribute('data-consent') === 'true') {
|
||||||
|
window.Cookies.set('cookieconsent', 'accept', cookie_options);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.Cookies.set('cookieconsent', 'decline', cookie_options);
|
||||||
|
}
|
||||||
|
cookieconsent.classList.remove('js-cookieconsent-open');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
// Cookieconsent
|
// Cookieconsent
|
||||||
|
|
||||||
.cookieconsent {
|
.cookieconsent {
|
||||||
@include type-layout(s, 1);
|
@include type-layout(s, 1);
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: $warning;
|
color: $warning;
|
||||||
background-color: $warning-bg;
|
background-color: $warning-bg;
|
||||||
border-top: 4px solid $warning-border;
|
border-top: 4px solid $warning-border;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
transform: translateY(100vh);
|
transform: translateY(100vh);
|
||||||
transition: all 130ms ease-in;
|
transition: all 130ms ease-in;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
|
|
@ -28,5 +28,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.js-cookieconsent-open {
|
.js-cookieconsent-open {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue