datenspuren food: ask for geolocation only when opened
This commit is contained in:
parent
af302e61e6
commit
8e0da31036
|
@ -70,13 +70,6 @@ function makeLink(link) {
|
|||
return a
|
||||
}
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(geo) {
|
||||
onGeo(geo)
|
||||
navigator.geolocation.watchPosition(onGeo, null, {
|
||||
enableHighAccuracy: true
|
||||
})
|
||||
})
|
||||
|
||||
var h3 = $('<h3 id="foodlocator">Imbißmöglichkeiten anzeigen</h3>')
|
||||
$('article').append(h3)
|
||||
|
||||
|
@ -85,6 +78,13 @@ h3.click(function() {
|
|||
if (ran) return
|
||||
ran = true
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(geo) {
|
||||
onGeo(geo)
|
||||
navigator.geolocation.watchPosition(onGeo, null, {
|
||||
enableHighAccuracy: true
|
||||
})
|
||||
})
|
||||
|
||||
h3.addClass('expanded')
|
||||
h3.text("Lade Imbißmöglichkeiten...")
|
||||
|
||||
|
|
Loading…
Reference in New Issue