Preserve detail panel and range circle across score updates
- Add phx-update="ignore" to detail-panel so LiveView patches don't wipe it - Re-request point_detail after scores update to refresh with new data - Range circles persist across updates since they're on a separate layer
This commit is contained in:
parent
8949920b7f
commit
c775eb2611
2 changed files with 7 additions and 1 deletions
|
|
@ -329,6 +329,11 @@ export const PropagationMap = {
|
|||
this.handleEvent("update_scores", ({ scores }) => {
|
||||
topbar.hide()
|
||||
this.renderScores(scores)
|
||||
|
||||
// If a point was selected, refresh its detail with the new data
|
||||
if (this.clickedLatLng && this.detailPanel && this.detailPanel.style.display !== "none") {
|
||||
this.pushEvent("point_detail", { lat: this.clickedLatLng[0], lon: this.clickedLatLng[1] })
|
||||
}
|
||||
})
|
||||
|
||||
this.bandInfo = JSON.parse(this.el.dataset.bandInfo || "{}")
|
||||
|
|
|
|||
|
|
@ -280,9 +280,10 @@ defmodule MicrowavepropWeb.MapLive do
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<%!-- Point detail panel (populated by JS on click) --%>
|
||||
<%!-- Point detail panel (populated by JS on click, ignored by LiveView patches) --%>
|
||||
<div
|
||||
id="detail-panel"
|
||||
phx-update="ignore"
|
||||
class="bg-neutral text-neutral-content shadow rounded-box border border-base-300 overflow-hidden"
|
||||
style="display:none;"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue