Fuckin' Cookie-Banner

This commit is contained in:
2019-03-24 16:00:37 +01:00
parent fa13a3df3e
commit 50f6b0afe6
5 changed files with 95 additions and 6 deletions
@@ -1,9 +1,9 @@
$(function() {
initDatepickerRange();
initAvailabilityCalendar();
$('[data-toggle="tooltip"]').tooltip({
placement: 'bottom'
});
initCookieInfo();
initCookieAcceptButtonAction();
initTooltips();
});
@@ -26,4 +26,29 @@ function initAvailabilityCalendar() {
$cal.availabilityCalendar(unavailableDates);
});
}
function initTooltips() {
$('[data-toggle="tooltip"]').tooltip({
placement: 'bottom'
});
}
function initCookieInfo() {
var $section = $('section.cookie');
var accepted = localStorage.getItem('Dein.Equipment.Cookie.Accepted');
if(accepted) {
$section.remove();
}
}
function initCookieAcceptButtonAction() {
var $section = $('section.cookie');
var $acceptBtn = $section.find('button:first');
$acceptBtn.click(function(e) {
e.preventDefault();
localStorage.setItem('Dein.Equipment.Cookie.Accepted', true);
$section.remove();
});
}