Skip to content

Commit

Permalink
lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Dec 10, 2024
1 parent fb72aca commit 47a3d7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/javascript/application2.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ window.dispatchEvent(new Event("vega:load"))
document.addEventListener("turbo:load", function() {
// Show the toast when the page loads if it's been rendered.
// The logic for deciding if we need to show the banner is in the server side partial _consent_toast.html.erb.
let toastEl = document.getElementById('consent_banner');
const toastEl = document.getElementById('consent_banner');
if (toastEl){
let toast = new bootstrap.Toast(toastEl);
const toast = new bootstrap.Toast(toastEl);
toast.show();
}

let cookiesEuOKButton = document.querySelector('.js-cookies-eu-ok');
const cookiesEuOKButton = document.querySelector('.js-cookies-eu-ok');
if (cookiesEuOKButton) {
cookiesEuOKButton.addEventListener('click', setCookie, false);
}

});

function setCookie(target) {
function setCookie() {
const isSecure = location.protocol === 'https:';
Cookies.set('cookie_eu_consented', true, { path: '/', expires: 365, secure: isSecure });
}
Expand Down

0 comments on commit 47a3d7a

Please sign in to comment.