Fuckin' Cookie-Banner
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user