diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-07-14 18:26:23 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-07-14 18:26:23 +0200 |
commit | 7a34f64eba2aec25c4493910963783aeb4c4a8c7 (patch) | |
tree | eeb4333525bada0f87c0ba1502834b12431f68e9 | |
parent | e361d39c0afa85f0f8245ce0305ebf1d3c3e709e (diff) |
geolocation: Use large-click-area links for station list
-rw-r--r-- | public/static/js/geolocation.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/public/static/js/geolocation.js b/public/static/js/geolocation.js index 50801a5..f186d2e 100644 --- a/public/static/js/geolocation.js +++ b/public/static/js/geolocation.js @@ -26,22 +26,16 @@ $(document).ready(function() { } else if (data.candidates.length == 0) { showError('Keine Bahnhöfe in 70km Umkreis gefunden', '', null); } else { - resultTable = $('<table><tbody></tbody></table>') - resultBody = resultTable.children(); + const res = $(document.createElement('p')); $.each(data.candidates, function(i, candidate) { - var ds100 = candidate.ds100, + const ds100 = candidate.ds100, name = candidate.name, - distance = candidate.distance; - distance = distance.toFixed(1); + distance = candidate.distance.toFixed(1); - var stationlink = $(document.createElement('a')); - stationlink.attr('href', ds100); - stationlink.text(name); - - resultBody.append('<tr><td><a href="/s/' + ds100 + '">' + name + '</a></td></tr>'); + res.append($('<a class="tablerow" href="/s/' + ds100 + '"><span>' + name + '</span></a>')); }); - getPlaceholder().replaceWith(resultTable); + getPlaceholder().replaceWith(res); } }; |