diff --git a/vr_club_site/templates/site/js/calendar.js b/vr_club_site/templates/site/js/calendar.js index d98cfc9..ede05b3 100644 --- a/vr_club_site/templates/site/js/calendar.js +++ b/vr_club_site/templates/site/js/calendar.js @@ -121,8 +121,9 @@ document.addEventListener("DOMContentLoaded", function () { prevMonthBtn.addEventListener("click", prevMonth); nextMonthBtn.addEventListener("click", nextMonth); }); - +var popupScrollPosition; function openPopup(day, month, year) { + popupScrollPosition = window.scrollY; const dateDiv = document.querySelector('.booking-date'); const monthsNames = [ "січня", @@ -157,6 +158,7 @@ function closePopup() { const body = document.querySelector('body'); popup.style.display = 'none'; body.style.overflow = 'auto'; + window.scrollTo(0, popupScrollPosition); } window.addEventListener('popstate', function(event) {