summaryrefslogtreecommitdiff
path: root/public/static/js/geolocation.js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-05 12:30:34 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-05 12:30:46 +0200
commit85636af26a6f5c266107e2f26f697bc9de0bb69d (patch)
tree72ed6806266b5f203b89d0643c87f0d358121e3d /public/static/js/geolocation.js
parent8c23c960426bad133484bf127f5fc5b56af8e8c7 (diff)
do not perform useless geolocation lookups (#10)
Diffstat (limited to 'public/static/js/geolocation.js')
-rw-r--r--public/static/js/geolocation.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/public/static/js/geolocation.js b/public/static/js/geolocation.js
index 9cde56d..ccc8c3a 100644
--- a/public/static/js/geolocation.js
+++ b/public/static/js/geolocation.js
@@ -56,9 +56,11 @@ $(document).ready(function() {
}
};
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(processLocation, processError);
- } else {
- showError('Standortanfragen werden von diesem Browser nicht unterstützt', '', null);
+ if ($('div.geolocation').length) {
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(processLocation, processError);
+ } else {
+ showError('Standortanfragen werden von diesem Browser nicht unterstützt', '', null);
+ }
}
});