Skip to content

Commit

Permalink
feat: add close popup with back btn
Browse files Browse the repository at this point in the history
  • Loading branch information
RezenkovD committed Aug 11, 2023
1 parent 44971a6 commit 288b8c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions vr_club_site/templates/site/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,14 @@ function closePopup() {
popup.style.display = 'none';
body.style.overflow = 'auto';
}

window.addEventListener('popstate', function(event) {
var state = event.state;

if (state && state.popupOpen) {
openPopup(day, month, year);
} else {
closePopup();
}
});

2 changes: 0 additions & 2 deletions vr_club_site/templates/site/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ window.onload = function() {
}
};

wrapper.addEventListener("mouseenter", () => clearTimeout(timeoutId));

const buttons = document.querySelectorAll('.btn-blue');
buttons.forEach(button => {
button.addEventListener('click', redirectToBooking);
Expand Down

0 comments on commit 288b8c1

Please sign in to comment.