mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
fix: use htmx.trigger instead of dispatchEvent for HTMX swap
dispatchEvent(submit) was triggering native form submission (full page reload). htmx.trigger() properly triggers HTMX swap. Also re-enable initial rebindEventLayers so polygons load on first render.
This commit is contained in:
parent
420dc2a614
commit
a7bdb005f4
1 changed files with 2 additions and 4 deletions
|
|
@ -239,9 +239,7 @@
|
||||||
southInput.value = bounds.getSouth().toFixed(4);
|
southInput.value = bounds.getSouth().toFixed(4);
|
||||||
eastInput.value = bounds.getEast().toFixed(4);
|
eastInput.value = bounds.getEast().toFixed(4);
|
||||||
westInput.value = bounds.getWest().toFixed(4);
|
westInput.value = bounds.getWest().toFixed(4);
|
||||||
document.getElementById("filter-form").dispatchEvent(
|
htmx.trigger(document.getElementById("filter-form"), "submit");
|
||||||
new Event("submit", { bubbles: true })
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildPopup(row) {
|
function buildPopup(row) {
|
||||||
|
|
@ -417,7 +415,7 @@
|
||||||
document.getElementById("fit-to-results").addEventListener("click", fitToAllLayers);
|
document.getElementById("fit-to-results").addEventListener("click", fitToAllLayers);
|
||||||
|
|
||||||
// Initial load - bind layers and fit bounds
|
// Initial load - bind layers and fit bounds
|
||||||
// rebindEventLayers(); // DISABLED: map shows all events, only table filters
|
rebindEventLayers(); // Initial load only
|
||||||
if (false) { // DISABLED: map never auto-fits
|
if (false) { // DISABLED: map never auto-fits
|
||||||
fitToAllLayers();
|
fitToAllLayers();
|
||||||
isInitialLoad = false;
|
isInitialLoad = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue