Fix alignment of altitude values

This commit is contained in:
Carlos Salaverria 2016-09-12 17:08:22 -05:00
parent e784b529a8
commit 647319d141
3 changed files with 12 additions and 4 deletions

View file

@ -57,13 +57,17 @@ function format_altitude_brief(alt, vr, displayUnits) {
alt_text = Math.round(convert_altitude(alt, displayUnits)) + NBSP; alt_text = Math.round(convert_altitude(alt, displayUnits)) + NBSP;
// Vertical Rate Triangle // Vertical Rate Triangle
var verticalRateTriangle = "<span class=\"verticalRateTriangle\">";
if (vr > 128){ if (vr > 128){
return alt_text + UP_TRIANGLE; verticalRateTriangle += UP_TRIANGLE;
} else if (vr < -128){ } else if (vr < -128){
return alt_text + DOWN_TRIANGLE; verticalRateTriangle += DOWN_TRIANGLE;
} else { } else {
return alt_text + NBSP; verticalRateTriangle += NBSP;
} }
verticalRateTriangle += "</span>"
return alt_text + verticalRateTriangle;
} }
// alt in feet // alt in feet

View file

@ -871,7 +871,7 @@ function refreshTableInfo() {
tableplane.tr.cells[3].textContent = (tableplane.registration !== null ? tableplane.registration : ""); tableplane.tr.cells[3].textContent = (tableplane.registration !== null ? tableplane.registration : "");
tableplane.tr.cells[4].textContent = (tableplane.icaotype !== null ? tableplane.icaotype : ""); tableplane.tr.cells[4].textContent = (tableplane.icaotype !== null ? tableplane.icaotype : "");
tableplane.tr.cells[5].textContent = (tableplane.squawk !== null ? tableplane.squawk : ""); tableplane.tr.cells[5].textContent = (tableplane.squawk !== null ? tableplane.squawk : "");
tableplane.tr.cells[6].textContent = format_altitude_brief(tableplane.altitude, tableplane.vert_rate, DisplayUnits); tableplane.tr.cells[6].innerHTML = format_altitude_brief(tableplane.altitude, tableplane.vert_rate, DisplayUnits);
tableplane.tr.cells[7].textContent = format_speed_brief(tableplane.speed, DisplayUnits); tableplane.tr.cells[7].textContent = format_speed_brief(tableplane.speed, DisplayUnits);
tableplane.tr.cells[8].textContent = format_vert_rate_brief(tableplane.vert_rate, DisplayUnits); tableplane.tr.cells[8].textContent = format_vert_rate_brief(tableplane.vert_rate, DisplayUnits);
tableplane.tr.cells[9].textContent = format_distance_brief(tableplane.sitedist, DisplayUnits); tableplane.tr.cells[9].textContent = format_distance_brief(tableplane.sitedist, DisplayUnits);

View file

@ -143,6 +143,10 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
text-align: center; text-align: center;
} }
.verticalRateTriangle {
font-family: monospace;
}
.vPosition { background-color: #C3FFDF; } .vPosition { background-color: #C3FFDF; }
.mlat { background-color: #C7EAFC; } .mlat { background-color: #C7EAFC; }
.squawk7500 { font-weight: bold; background-color: #ff5555; } .squawk7500 { font-weight: bold; background-color: #ff5555; }