datenspuren food: ask for geolocation only when opened

This commit is contained in:
Astro 2015-09-21 21:40:50 +02:00
parent af302e61e6
commit 8e0da31036
1 changed files with 7 additions and 7 deletions

View File

@ -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...")