From 80eca0ff9a1688c7e048e18d2f7c361d9ab336ca Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 9 May 2017 12:23:03 -0500 Subject: [PATCH] Always show correct source on data popup --- public_html/script.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index 795c750..39138e1 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -910,7 +910,7 @@ function refreshSelected() { } else { $('#selected_position').text(format_latlng(selected.position)); } - $('#selected_source').text( (selected.position_from_mlat ? "MLAT" : "ADS-B")); + $('#selected_follow').removeClass('hidden'); if (FollowSelected) { $('#selected_follow').css('font-weight', 'bold'); @@ -919,7 +919,15 @@ function refreshSelected() { $('#selected_follow').css('font-weight', 'normal'); } } - + if (selected.getDataSource() === "adsb_icao") { + $('#selected_source').text("ADS-B"); + } else if (selected.getDataSource() === "tisb_trackfile" || selected.getDataSource() === "tisb_icao" || selected.getDataSource() === "tisb_other") { + $('#selected_source').text("TIS-B"); + } else if (selected.getDataSource() === "mlat") { + $('#selected_source').text("MLAT"); + } else { + $('#selected_source').text("Other"); + } $('#selected_sitedist').text(format_distance_long(selected.sitedist, DisplayUnits)); $('#selected_rssi').text(selected.rssi.toFixed(1) + ' dBFS'); $('#selected_message_count').text(selected.messages);