From 29e5fce89ee3abab15f5205c5fe3fe792b5ea629 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 1 Jun 2024 16:10:17 +0200 Subject: [PATCH] Do not block the booking page if the cookieconsent is blocked (#1398) --- assets/js/pages/booking.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index e6d48e0d..f2c25a27 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -65,7 +65,7 @@ App.Pages.Booking = (function () { * Initialize the module. */ function initialize() { - if (Boolean(Number(vars('display_cookie_notice')))) { + if (Boolean(Number(vars('display_cookie_notice'))) && window?.cookieconsent) { cookieconsent.initialise({ palette: { popup: { @@ -426,11 +426,10 @@ App.Pages.Booking = (function () { }); // Scroll to the top of the page. On a small screen, especially on a mobile device, this is very useful. - const scrollingElement = (document.scrollingElement || document.body); + const scrollingElement = document.scrollingElement || document.body; if (window.innerHeight < scrollingElement.scrollHeight) { scrollingElement.scrollTop = 0; } - }); /**