diff options
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/front.js | 7 | ||||
-rw-r--r-- | web/js/geolocation.js | 2 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 16 |
3 files changed, 9 insertions, 16 deletions
diff --git a/web/js/front.js b/web/js/front.js index 8471972d4..67486888b 100644 --- a/web/js/front.js +++ b/web/js/front.js @@ -15,4 +15,11 @@ document.getElementById('pc').focus(); var link = around_links[i]; link.href = link.href + (link.href.indexOf('?') > -1 ? '&js=1' : '?js=1'); } + + var lk = document.querySelector('span.report-a-problem-btn'); + if (lk.addEventListener) { + lk.addEventListener('click', function(){ + scrollTo(0,0); + }); + } })(); 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); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 7d0f9076e..a96e65953 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -8,7 +8,7 @@ $.extend(fixmystreet.utils, { if (!location.search) { return qs; } - location.search.substring(1).split(/[;&]/).forEach(function(i) { + $.each(location.search.substring(1).split(/[;&]/), function(n, i) { var s = i.split('='), k = s[0], v = s[1] && decodeURIComponent(s[1].replace(/\+/g, ' ')); @@ -330,20 +330,6 @@ $.extend(fixmystreet.utils, { fixmystreet.markers.refresh({force: true}); } - function parse_query_string() { - var qs = {}; - if (!location.search) { - return qs; - } - location.search.substring(1).split(/[&;]/).forEach(function(i) { - var s = i.split('='), - k = s[0], - v = s[1] && decodeURIComponent(s[1].replace(/\+/g, ' ')); - qs[k] = v; - }); - return qs; - } - function replace_query_parameter(qs, id, key) { var value = $('#' + id).val(); if (value) { |