aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js')
-rw-r--r--web/js/fixmystreet.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js
index 9cb48bb9d..19f1f0402 100644
--- a/web/js/fixmystreet.js
+++ b/web/js/fixmystreet.js
@@ -206,25 +206,25 @@ $(function(){
// Geolocation
if (geo_position_js.init()) {
- $('#postcodeForm').append('<p id="geolocate_para">Or <a href="#" id="geolocate_link">locate me automatically</a>').css({ "padding-bottom": "0.5em" });
+ $('#postcodeForm').after('<a href="#" id="geolocate_link">&hellip; or locate me automatically</a>');
$('#geolocate_link').click(function(e) {
e.preventDefault();
// Spinny thing!
- $('#geolocate_para').append(' <img src="/i/flower.gif" alt="" align="bottom">');
+ $(this).append(' <img src="/i/flower.gif" alt="" align="bottom">');
geo_position_js.getCurrentPosition(function(pos) {
- $('#geolocate_para img').remove();
+ $('img', this).remove();
var latitude = pos.coords.latitude;
var longitude = pos.coords.longitude;
location.href = '/around?latitude=' + latitude + ';longitude=' + longitude;
}, function(err) {
- $('#geolocate_para img').remove();
+ $('img', this).remove();
if (err.code == 1) { // User said no
} else if (err.code == 2) { // No position
- $('#geolocate_para').html("Could not look up location");
+ $(this).html("Could not look up location");
} else if (err.code == 3) { // Too long
- $('#geolocate_para').html("No result returned");
+ $('this').html("No result returned");
} else { // Unknown
- $('#geolocate_para').html("Unknown error");
+ $('this').html("Unknown error");
}
}, {
timeout: 10000