diff options
Diffstat (limited to 'public/static/js/geolocation.js')
-rw-r--r-- | public/static/js/geolocation.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/public/static/js/geolocation.js b/public/static/js/geolocation.js index 03857a1..a496900 100644 --- a/public/static/js/geolocation.js +++ b/public/static/js/geolocation.js @@ -24,7 +24,7 @@ $(document).ready(function() { const res = $(document.createElement('p')); $.each(stops, function(i, stop) { const parts = stop.split(';'); - const node = $('<a class="tablerow" href="/s/' + parts[0] + '?hafas=' + parts[2] + '"><span><i class="material-icons" aria-hidden="true">' + (parseInt(parts[2]) ? 'directions' : 'train') + '</i>' + parts[1] + '</span></a>'); + const node = $('<a class="tablerow" href="/s/' + parts[0] + '?hafas=' + parts[2] + '"><span><i class="material-icons" aria-hidden="true">' + (parts[2] == '0' ? 'train' : 'directions') + '</i>' + parts[1] + '</span></a>'); node.click(function() { $('nav .preloader-wrapper').addClass('active'); }); @@ -51,7 +51,7 @@ $(document).ready(function() { hafas = candidate.hafas, distance = candidate.distance.toFixed(1); - const node = $('<a class="tablerow" href="/s/' + eva + '?hafas=' + hafas + '"><span><i class="material-icons" aria-hidden="true">' + (parseInt(hafas) ? 'directions' : 'train') + '</i>' + name + '</span></a>'); + const node = $('<a class="tablerow" href="/s/' + eva + '?hafas=' + hafas + '"><span><i class="material-icons" aria-hidden="true">' + (hafas == '0' ? 'train' : 'directions') + '</i>' + name + '</span></a>'); node.click(function() { $('nav .preloader-wrapper').addClass('active'); }); @@ -62,7 +62,8 @@ $(document).ready(function() { }; const processLocation = function(loc) { - $.post('/geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude}, processResult); + const backend = $('div.geolocation').data('backend'); + $.post('/geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude, backend: backend}, processResult); }; const processError = function(error) { @@ -77,7 +78,7 @@ $(document).ready(function() { } }; - const geoLocationButton = $('div.geolocation > button'); + const geoLocationButton = $('div.geolocation > .request'); const recentStops = geoLocationButton.data('recent'); const getGeoLocation = function() { geoLocationButton.replaceWith($('<p class="geolocationhint">Stationen in der Umgebung:</p><div class="progress"><div class="indeterminate"></div></div>')); |