fix: round €/m² in Telegram, drop "Bilder nachladen" admin button, fix lightbox visibility
- notifications: round sqm_price to whole € in Telegram match messages
(was emitting raw float like "12.345614 €/m²").
- wohnungen: remove the admin-only "Bilder nachladen (N)" button. It
flickered into view whenever a freshly-scraped flat was still in
pending state, which was effectively random from the user's point of
view, and the manual backfill it triggered isn't needed anymore — new
flats are auto-enriched at scrape time. Also drops the dead helpers
it was the sole caller of: enrichment.kick_backfill,
enrichment._backfill_runner, db.flats_needing_enrichment,
db.enrichment_counts.
- lightbox: the modal didn't appear because Tailwind's Play CDN injects
its own .hidden { display: none } rule at runtime, which kept fighting
our class toggle. Switch the show/hide to inline style.display so no
external stylesheet can mask it. Single-class .lightbox now only owns
the layout — the initial-hidden state is on the element via
style="display:none".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
787f848aba
commit
ee7ba6c6ff
8 changed files with 14 additions and 76 deletions
|
|
@ -131,9 +131,16 @@ document.addEventListener("DOMContentLoaded", openDeepLinkedFlat);
|
|||
|
||||
// Image lightbox — single global modal in base.html, opened by clicking any
|
||||
// .flat-gallery-tile. Click handler is delegated so it survives HTMX swaps.
|
||||
// Visibility is driven by inline style.display rather than a `hidden` class
|
||||
// because Tailwind's CDN injects its own `.hidden { display: none }` rule
|
||||
// at runtime, which conflicted with our class toggle and kept the modal
|
||||
// invisible after open().
|
||||
(function () {
|
||||
const overlay = document.getElementById("lazyflat-lightbox");
|
||||
if (!overlay) return;
|
||||
if (!overlay) {
|
||||
console.warn("[lazyflat.lightbox] #lazyflat-lightbox not in DOM; viewer disabled");
|
||||
return;
|
||||
}
|
||||
const imgEl = overlay.querySelector(".lightbox-image");
|
||||
const counterEl = overlay.querySelector(".lightbox-counter");
|
||||
const prevBtn = overlay.querySelector("[data-lightbox-prev]");
|
||||
|
|
@ -154,14 +161,14 @@ document.addEventListener("DOMContentLoaded", openDeepLinkedFlat);
|
|||
if (!list.length) return;
|
||||
urls = list;
|
||||
idx = Math.max(0, Math.min(startIdx | 0, urls.length - 1));
|
||||
overlay.classList.remove("hidden");
|
||||
overlay.style.display = "flex";
|
||||
overlay.setAttribute("aria-hidden", "false");
|
||||
document.body.classList.add("lightbox-open");
|
||||
render();
|
||||
}
|
||||
|
||||
function close() {
|
||||
overlay.classList.add("hidden");
|
||||
overlay.style.display = "none";
|
||||
overlay.setAttribute("aria-hidden", "true");
|
||||
document.body.classList.remove("lightbox-open");
|
||||
imgEl.removeAttribute("src");
|
||||
|
|
@ -182,7 +189,7 @@ document.addEventListener("DOMContentLoaded", openDeepLinkedFlat);
|
|||
if (ev.target === overlay) close();
|
||||
});
|
||||
document.addEventListener("keydown", (ev) => {
|
||||
if (overlay.classList.contains("hidden")) return;
|
||||
if (overlay.style.display === "none") return;
|
||||
if (ev.key === "Escape") close();
|
||||
else if (ev.key === "ArrowLeft") step(-1);
|
||||
else if (ev.key === "ArrowRight") step(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue