aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-07-04 17:26:42 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-07-06 17:55:53 +0100
commitc0176254c3716e9e9915f3fd0f875f43e5e1e4ed (patch)
tree888a1a3c7d9692247b55a764f9bbeb7b0f9f01f8 /web
parent85835c0146421a16a84626b4e9004da73ab70b11 (diff)
Better handling of JS geolocation.
Puts it back on alert page, lost in July 2016.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index bc1d7d9a0..a5b09f2c7 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -383,13 +383,13 @@ $.extend(fixmystreet.set_up, {
if (!geo_position_js.init()) {
return;
}
- if ($('#postcodeForm').length) {
- var link = '<a href="LINK" id="geolocate_link">&hellip; ' + translation_strings.geolocate + '</a>';
- $('form[action="/alert/list"]').append(link.replace('LINK','/alert/list'));
+ if ($('.js-geolocate').length) {
+ var link = $('.js-geolocate').attr('action');
+ link = '<a href="' + link + '" id="geolocate_link">&hellip; ' + translation_strings.geolocate + '</a>';
if ($('body.frontpage').length) {
- $('#postcodeForm').after(link.replace('LINK','/around'));
+ $('.js-geolocate').after(link);
} else{
- $('#postcodeForm').append(link.replace('LINK','/around'));
+ $('.js-geolocate').append(link);
}
fixmystreet.geolocate.setup(function(pos) {
var latitude = pos.coords.latitude;