Not found.
'; }
else renderDetail(d);
panel.classList.remove('loading');
}).catch(()=>{ dpBody.innerHTML = 'Could not load.
'; panel.classList.remove('loading'); });
return false;
}
function closeDetail(push) {
activeDetailId = null;
panel.classList.remove('open');
panel.setAttribute('aria-hidden','true');
document.querySelectorAll('.prop-card.active').forEach(c => c.classList.remove('active'));
if (push !== false) {
const url = new URL(window.location);
url.searchParams.delete('selected');
history.pushState({}, '', url);
}
}
// back/forward
window.addEventListener('popstate', (e) => {
const sel = new URL(window.location).searchParams.get('selected');
if (sel) openDetailFromHistory(parseInt(sel));
else closeDetail(false);
});
function openDetailFromHistory(id) {
activeDetailId = id;
panel.classList.add('open','loading');
panel.setAttribute('aria-hidden','false');
document.querySelectorAll('.prop-card').forEach(c => c.classList.toggle('active', c.dataset.id == id));
fetch(`/api/property/${id}/detail`).then(r=>r.json()).then(d => {
if (activeDetailId != id) return;
if (d && d.id) renderDetail(d);
panel.classList.remove('loading');
});
}
// Esc closes
document.addEventListener('keydown', e => { if (e.key === 'Escape' && panel.classList.contains('open')) closeDetail(); });
// Open on load if ?selected= present (shared URL)
(function(){
const sel = new URL(window.location).searchParams.get('selected');
if (sel) openDetailFromHistory(parseInt(sel));
})();
๐
Unlock owner contacts for 78,335+ businesses
Phone numbers, emails, valuations & more