[fix](trx-frontend-http): fix APRS bar coords visibility, cap at 5 entries
Coordinates were clipped by white-space:nowrap on the frame row. Split each frame into a .aprs-bar-frame-main line (nowrap+ellipsis) and a separate .aprs-bar-frame-pos line for the coordinate button, so coordinates are always visible regardless of info length. Restore 5-entry cap (slice from history). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -107,7 +107,7 @@ function applyAprsFilterToAll() {
|
||||
function updateAprsBar() {
|
||||
if (!aprsBarOverlay) return;
|
||||
const isPkt = (document.getElementById("mode")?.value || "").toUpperCase() === "PKT";
|
||||
const okFrames = aprsPacketHistory.filter((p) => p.crcOk);
|
||||
const okFrames = aprsPacketHistory.filter((p) => p.crcOk).slice(0, 5);
|
||||
if (!isPkt || okFrames.length === 0) {
|
||||
aprsBarOverlay.style.display = "none";
|
||||
return;
|
||||
@@ -119,9 +119,12 @@ function updateAprsBar() {
|
||||
const dest = escapeMapHtml(pkt.destCall || "");
|
||||
const info = escapeMapHtml(pkt.info || "");
|
||||
const posHtml = pkt.lat != null && pkt.lon != null
|
||||
? ` <button class="aprs-bar-pos" onclick="window.navigateToAprsMap(${pkt.lat},${pkt.lon})">${pkt.lat.toFixed(4)}, ${pkt.lon.toFixed(4)}</button>`
|
||||
? `<button class="aprs-bar-pos" onclick="window.navigateToAprsMap(${pkt.lat},${pkt.lon})">${pkt.lat.toFixed(4)}, ${pkt.lon.toFixed(4)}</button>`
|
||||
: "";
|
||||
html += `<div class="aprs-bar-frame">${ts}${call}>${dest}: ${info}${posHtml}</div>`;
|
||||
html += `<div class="aprs-bar-frame">` +
|
||||
`<div class="aprs-bar-frame-main">${ts}${call}>${dest}: ${info}</div>` +
|
||||
(posHtml ? `<div class="aprs-bar-frame-pos">${posHtml}</div>` : "") +
|
||||
`</div>`;
|
||||
}
|
||||
aprsBarOverlay.innerHTML = html;
|
||||
aprsBarOverlay.style.display = "flex";
|
||||
|
||||
Reference in New Issue
Block a user