summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js')
-rw-r--r--static/js/geolocation.js11
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);