mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-08-04 22:06:34 +00:00
handle null headsign
This commit is contained in:
+1
-1
@@ -300,6 +300,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module" src="/js/main.js?v=6"></script>
|
||||
<script type="module" src="/js/main.js?v=7"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+13
-2
@@ -166,10 +166,21 @@ function renderVehicleIcon(vehicle) {
|
||||
}
|
||||
|
||||
function vehiclePopupContent(vehicle) {
|
||||
return `<b>${routeDesignator(vehicle.route)}</b> to <b>${vehicle.headsign?.replace(
|
||||
let content = `<b>${routeDesignator(vehicle.route)}</b>`
|
||||
if (vehicle.headsign) {
|
||||
content += ` to <b>${vehicle.headsign.replace(
|
||||
/^to /i,
|
||||
""
|
||||
)}</b>${vehicle.nearest_station ? `<br />@ ${vehicle.nearest_station?.name}` : ""}<br /><br /><small>vehicle #: ${vehicle.id}</small>`
|
||||
)}</b>`
|
||||
}
|
||||
|
||||
if (vehicle.nearest_station) {
|
||||
content += `<br />@ ${vehicle.nearest_station.name}`
|
||||
}
|
||||
|
||||
content += `<br /><br /><small>vehicle #: ${vehicle.id}</small>`
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
function renderVehicle(vehicle) {
|
||||
|
||||
Reference in New Issue
Block a user