From ce36607d48c512219572032fa1b34bdb2de9e092 Mon Sep 17 00:00:00 2001 From: RezenkovD Date: Mon, 14 Aug 2023 09:25:59 +0300 Subject: [PATCH] test --- vr_club_site/templates/site/js/calendar.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {