diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-08-22 11:44:59 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-08-22 11:45:08 +0200 |
commit | b37e26d5ea1e7ab9a40e8f66d49d421c3a59d5fa (patch) | |
tree | 0a64d6850e9dd2d39cdf62a8fcc2c312b8d2dad0 /static/js | |
parent | 4596613e65581712f6c230f87971edfabd0ae919 (diff) |
Fix geolocation stop list generation0.3.1
Diffstat (limited to 'static/js')
-rw-r--r-- | static/js/geolocation.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/static/js/geolocation.js b/static/js/geolocation.js index eeb535f..22e15df 100644 --- a/static/js/geolocation.js +++ b/static/js/geolocation.js @@ -21,13 +21,15 @@ document.addEventListener("DOMContentLoaded", function() { result = results[result]; const listentry = document.createElement("li"); const link = document.createElement("a"); + const name = document.createElement("span"); const note = document.createElement("span"); const lines = document.createElement("span"); - link.className = "name"; - link.textContent = result.name; link.href = "/board/" + result.id; + name.className = "name"; + name.textContent = result.name; + note.className = "distance"; if (result.distance >= 1000) { note.textContent = (result.distance / 1000).toFixed(1) + " km" @@ -65,9 +67,10 @@ document.addEventListener("DOMContentLoaded", function() { lines.appendChild(mkTextNode("taxi", "AST")); } + link.appendChild(name); + link.appendChild(note); + link.appendChild(lines); listentry.appendChild(link); - listentry.appendChild(note); - listentry.appendChild(lines); list.appendChild(listentry); } geoLocationButton.replaceWith(list); |