aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorJosh Angell <josh@supercooldesign.co.uk>2012-02-15 17:11:02 +0000
committerJosh Angell <josh@supercooldesign.co.uk>2012-02-15 17:11:02 +0000
commitfca03277615ab3ed1cb21f147e6f5cf5da604fbd (patch)
treebde056c196de1441ad42486b7ee9510913d101bf /web/js
parentea6543c657c974bb22fed02f0fe491de06f41d0a (diff)
Homepage mobile view mainly done
Signed-off-by: Josh Angell <josh@supercooldesign.co.uk>
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