Если открываешь overlay-карту и через неё открываешь Overlay-карточку объекта, после закрывания всех overlay страница зависает и не реагирует на scrolling, исправь пожалуйста - Follow Up Deployment
Browse files- index.html +21 -9
index.html
CHANGED
|
@@ -1539,6 +1539,7 @@
|
|
| 1539 |
// Close overlay map
|
| 1540 |
document.getElementById('map-overlay-close').addEventListener('click', function() {
|
| 1541 |
document.getElementById('map-overlay').classList.remove('active');
|
|
|
|
| 1542 |
});
|
| 1543 |
});
|
| 1544 |
|
|
@@ -1620,15 +1621,23 @@
|
|
| 1620 |
const overlay = document.getElementById('property-overlay');
|
| 1621 |
const closeOverlay = document.querySelector('.close-overlay');
|
| 1622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1623 |
function openPropertyOverlay(buttonOrIndex) {
|
| 1624 |
// Handle both button element and index number
|
| 1625 |
const button = typeof buttonOrIndex === 'number'
|
| 1626 |
? document.querySelectorAll('.view-details-btn')[buttonOrIndex]
|
| 1627 |
: buttonOrIndex;
|
| 1628 |
|
| 1629 |
-
|
| 1630 |
-
const mapOverlay = document.getElementById('map-overlay');
|
| 1631 |
-
const isMapOverlayOpen = mapOverlay.classList.contains('active');
|
| 1632 |
const propertyCard = button.closest('.property-card');
|
| 1633 |
const propertyData = propertyCard.dataset;
|
| 1634 |
const agentImg = propertyCard.querySelector('.agent-badge img').src;
|
|
@@ -1694,12 +1703,7 @@
|
|
| 1694 |
closeOverlay.addEventListener('click', function(e) {
|
| 1695 |
e.preventDefault();
|
| 1696 |
overlay.classList.remove('active');
|
| 1697 |
-
|
| 1698 |
-
// Only restore body overflow if map overlay isn't open
|
| 1699 |
-
const mapOverlay = document.getElementById('map-overlay');
|
| 1700 |
-
if (!mapOverlay.classList.contains('active')) {
|
| 1701 |
-
document.body.style.overflow = 'auto';
|
| 1702 |
-
}
|
| 1703 |
|
| 1704 |
// Clean up map when overlay closes
|
| 1705 |
if (propertyMap) {
|
|
@@ -1708,6 +1712,14 @@
|
|
| 1708 |
}
|
| 1709 |
});
|
| 1710 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1711 |
// Close overlay when clicking outside content
|
| 1712 |
overlay.addEventListener('click', function(e) {
|
| 1713 |
if (e.target === overlay) {
|
|
|
|
| 1539 |
// Close overlay map
|
| 1540 |
document.getElementById('map-overlay-close').addEventListener('click', function() {
|
| 1541 |
document.getElementById('map-overlay').classList.remove('active');
|
| 1542 |
+
enableBodyScroll();
|
| 1543 |
});
|
| 1544 |
});
|
| 1545 |
|
|
|
|
| 1621 |
const overlay = document.getElementById('property-overlay');
|
| 1622 |
const closeOverlay = document.querySelector('.close-overlay');
|
| 1623 |
|
| 1624 |
+
function disableBodyScroll() {
|
| 1625 |
+
document.body.style.overflow = 'hidden';
|
| 1626 |
+
document.body.style.touchAction = 'none';
|
| 1627 |
+
}
|
| 1628 |
+
|
| 1629 |
+
function enableBodyScroll() {
|
| 1630 |
+
document.body.style.overflow = '';
|
| 1631 |
+
document.body.style.touchAction = '';
|
| 1632 |
+
}
|
| 1633 |
+
|
| 1634 |
function openPropertyOverlay(buttonOrIndex) {
|
| 1635 |
// Handle both button element and index number
|
| 1636 |
const button = typeof buttonOrIndex === 'number'
|
| 1637 |
? document.querySelectorAll('.view-details-btn')[buttonOrIndex]
|
| 1638 |
: buttonOrIndex;
|
| 1639 |
|
| 1640 |
+
disableBodyScroll();
|
|
|
|
|
|
|
| 1641 |
const propertyCard = button.closest('.property-card');
|
| 1642 |
const propertyData = propertyCard.dataset;
|
| 1643 |
const agentImg = propertyCard.querySelector('.agent-badge img').src;
|
|
|
|
| 1703 |
closeOverlay.addEventListener('click', function(e) {
|
| 1704 |
e.preventDefault();
|
| 1705 |
overlay.classList.remove('active');
|
| 1706 |
+
enableBodyScroll();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1707 |
|
| 1708 |
// Clean up map when overlay closes
|
| 1709 |
if (propertyMap) {
|
|
|
|
| 1712 |
}
|
| 1713 |
});
|
| 1714 |
|
| 1715 |
+
// Close overlay when clicking outside content
|
| 1716 |
+
overlay.addEventListener('click', function(e) {
|
| 1717 |
+
if (e.target === overlay) {
|
| 1718 |
+
overlay.classList.remove('active');
|
| 1719 |
+
enableBodyScroll();
|
| 1720 |
+
}
|
| 1721 |
+
});
|
| 1722 |
+
|
| 1723 |
// Close overlay when clicking outside content
|
| 1724 |
overlay.addEventListener('click', function(e) {
|
| 1725 |
if (e.target === overlay) {
|