From 36c382ed12ba6da3164e256dd3e4ae97fa7235ea Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 30 Apr 2018 17:04:36 +0100 Subject: Some IE8/old JS workarounds. --- web/js/geolocation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/js/geolocation.js') diff --git a/web/js/geolocation.js b/web/js/geolocation.js index 3c2cf04df..fbef4d7ea 100644 --- a/web/js/geolocation.js +++ b/web/js/geolocation.js @@ -30,7 +30,7 @@ fixmystreet.geolocate = function(element, success_callback) { var link = document.getElementById('geolocate_link'); if (!link) { return; } var https = window.location.protocol.toLowerCase() === 'https:'; - if ('geolocation' in navigator && https) { + if ('geolocation' in navigator && https && window.addEventListener) { fixmystreet.geolocate(link, function(pos) { var latitude = pos.coords.latitude.toFixed(6); var longitude = pos.coords.longitude.toFixed(6); -- cgit v1.2.3