mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-10-03 16:06:19 +00:00
handle null headsign
This commit is contained in:
2 files changed
+14
-3
No files matched your search
+1
-1
@@ -300,6 +300,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="module" src="/js/main.js?v=6"></script>
|
<script type="module" src="/js/main.js?v=7"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+13
-2
@@ -166,10 +166,21 @@ function renderVehicleIcon(vehicle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function vehiclePopupContent(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,
|
/^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) {
|
function renderVehicle(vehicle) {
|
||||||
|
|||||||
Reference in new issue
Block a user