aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-05-03 11:08:05 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-03 11:08:05 +0100
commit1a84ff9e9c0675f9487da08e7f5d11088a5d79f8 (patch)
tree93940979281a13e2e05c41a7a27ae55791bfec49 /web/js
parent85cdf1d51ad06836f824a1053924185b7bc8f236 (diff)
parent536fdcd39d0d6bd76954d6baa672a3b7f266d155 (diff)
Merge branch 'drop-ie7'
Diffstat (limited to 'web/js')
-rw-r--r--web/js/front.js7
-rw-r--r--web/js/geolocation.js2
-rw-r--r--web/js/map-OpenLayers.js16
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) {