diff options
-rw-r--r-- | www/index.html | 2 | ||||
-rw-r--r-- | www/js/fixmystreet.js | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/www/index.html b/www/index.html index 46af1c5..fcb9c3c 100644 --- a/www/index.html +++ b/www/index.html @@ -51,7 +51,7 @@ <body id="container" class="frontpage fullwidthpage"> <!--ontouchmove="touchmove(event);">--> - <div class="wrapper" data-role="page"> + <div class="wrapper" id="front-page" data-role="page"> <div class="table-cell"> <!-- header id="site-header" role="banner"> <div class="container"> diff --git a/www/js/fixmystreet.js b/www/js/fixmystreet.js index 282e3f4..dac2efb 100644 --- a/www/js/fixmystreet.js +++ b/www/js/fixmystreet.js @@ -77,6 +77,14 @@ function tabs(elem, indirect) { } +$(document).delegate( '#front-page', 'pageshow', function(event, ui) { + // Geolocation + if (geo_position_js.init() && !$('#geolocate_link').length) { + $('#postcodeForm').after('<a href="#" id="geolocate_link">… or locate me automatically</a>'); + $('#geolocate_link').click(getPosition); + } +}); + $(document).bind('pageinit', function(){ var $html = $('html'); @@ -260,12 +268,6 @@ $(document).bind('pageinit', function(){ $('#form_category').change( form_category_onchange ); - // Geolocation - if (geo_position_js.init() && !$('#geolocate_link').length) { - $('#postcodeForm').after('<a href="#" id="geolocate_link">… or locate me automatically</a>'); - $('#geolocate_link').click(getPosition); - } - /* * Report a problem page */ |