Skip to content

Commit

Permalink
Cookie consent displaying fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebousan committed Mar 26, 2024
1 parent c762542 commit cb35862
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layouts/partials/footer/cookie-banner/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@
init() {
if(this.readCookie('cookie-consent')=='true') {
this.initCookies();
} else if (this.readCookie('cookie-consent')!='false' || this.readCookie('cookie-consent')=='false') {
} else if (this.readCookie('cookie-consent')=='false') {
this.removeCookies();
}
}

initCookies() {
this.elm.classList.remove('show');
if (this.id_ga) {
this.initGoogleAnalytics();
}
Expand All @@ -77,13 +78,12 @@
initEvents() {
this.elm.querySelector('.js-cookie-consent-accept').addEventListener("click", () => {
this.createCookie('cookie-consent','true',31);
this.elm.style.display = 'none';
this.initCookies();
});

this.elm.querySelector('.js-cookie-consent-refuse').addEventListener("click", () => {
this.createCookie('cookie-consent','false',31);
this.elm.style.display = 'none';
this.elm.classList.remove('show');
});
}

Expand Down

0 comments on commit cb35862

Please sign in to comment.