From b37e26d5ea1e7ab9a40e8f66d49d421c3a59d5fa Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 22 Aug 2021 11:44:59 +0200 Subject: Fix geolocation stop list generation --- static/js/geolocation.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'static/js') 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); -- cgit v1.2.3