left4me/l4d2web/static/js
mwiegand 87d56a0910
fix(web): event-delegate modal triggers so HTMX-swapped buttons work
The previous wiring attached click listeners on DOMContentLoaded, so
any [data-modal-open] / [data-modal-close] / dialog.modal element
that came in via a later HTMX partial swap silently lost its
behaviour. The server-detail Actions partial reloads its reset/delete
triggers on every state change, so reset was unclickable after the
first state change post-load.

Switch to a single delegated click handler on document. Same logic,
but matches via Element.closest() so it works regardless of when an
element was added to the DOM. No re-bind needed after HTMX swaps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:18:27 +02:00
..
blueprint-overlay-picker.js feat(l4d2-web): per-overlay server.cfg aliases — expose checkbox + auto-exec 2026-05-09 01:26:31 +02:00
csrf.js chore(l4d2): flatten component layout 2026-05-05 23:47:06 +02:00
file-tree.js fix(l4d2-web): file tree fetches in plain JS — vendored htmx is a stub 2026-05-08 20:23:04 +02:00
modal.js fix(web): event-delegate modal triggers so HTMX-swapped buttons work 2026-05-09 15:18:27 +02:00
sse.js feat(l4d2-web): server + overlay detail — live-refresh via HTMX, restructured 2026-05-09 01:27:30 +02:00