From fca03277615ab3ed1cb21f147e6f5cf5da604fbd Mon Sep 17 00:00:00 2001 From: Josh Angell Date: Wed, 15 Feb 2012 17:11:02 +0000 Subject: Homepage mobile view mainly done Signed-off-by: Josh Angell --- web/js/fixmystreet.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'web/js') 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('

Or locate me automatically').css({ "padding-bottom": "0.5em" }); + $('#postcodeForm').after('… or locate me automatically'); $('#geolocate_link').click(function(e) { e.preventDefault(); // Spinny thing! - $('#geolocate_para').append(' '); + $(this).append(' '); 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 -- cgit v1.2.3