From c0176254c3716e9e9915f3fd0f875f43e5e1e4ed Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 4 Jul 2017 17:26:42 +0100 Subject: Better handling of JS geolocation. Puts it back on alert page, lost in July 2016. --- templates/web/base/alert/index.html | 2 +- templates/web/base/around/postcode_form.html | 2 +- web/cobrands/fixmystreet/fixmystreet.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/web/base/alert/index.html b/templates/web/base/alert/index.html index 5c61e93d9..acef89a78 100644 --- a/templates/web/base/alert/index.html +++ b/templates/web/base/alert/index.html @@ -27,7 +27,7 @@ within a certain distance of a particular location.', "%s is the site name"), si [% loc('To find out what local alerts we have for you, please enter your postcode or street name and area' ) %] [% END %]

-
+
diff --git a/templates/web/base/around/postcode_form.html b/templates/web/base/around/postcode_form.html index 135a70294..69c95d311 100644 --- a/templates/web/base/around/postcode_form.html +++ b/templates/web/base/around/postcode_form.html @@ -6,7 +6,7 @@ question = c.cobrand.enter_postcode_text || loc('Enter a nearby street name and area'); %] - +
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 = '… ' + translation_strings.geolocate + ''; - $('form[action="/alert/list"]').append(link.replace('LINK','/alert/list')); + if ($('.js-geolocate').length) { + var link = $('.js-geolocate').attr('action'); + link = '… ' + translation_strings.geolocate + ''; 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; -- cgit v1.2.3