diff options
Diffstat (limited to 'src/js/views/around.js')
-rw-r--r-- | src/js/views/around.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/js/views/around.js b/src/js/views/around.js index 57b4bc6..8f5c43a 100644 --- a/src/js/views/around.js +++ b/src/js/views/around.js @@ -20,6 +20,7 @@ 'vclick #mark-here': 'onClickMark', 'vclick #locate-here': 'onClickMark', 'vclick #reposition': 'onClickReposition', + 'vclick #go-offline': 'onClickGoOffline', 'vclick a.address': 'goAddress', 'submit #postcodeForm': 'search' }, @@ -186,9 +187,13 @@ $('#mark-here').hide(); // if we are going to display the help then we don't want to focus on // the search box as it will show through the help - if ( FMS.usedBefore ) { + if ( FMS.usedBefore && (details.err && ! details.err == 'location_check_failed') ) { $('#pc').attr('placeholder', FMS.strings.search_placeholder).focus(); } + + if ( details.err == 'location_check_failed' ) { + $('#go-offline').show(); + } } $('#front-howto').html('<p>' + msg + '</p>'); $('#front-howto').show(); @@ -203,6 +208,7 @@ }, displayButtons: function(isLocationSet) { + $('#go-offline').hide(); if ( fixmystreet.map ) { fixmystreet.nav.activate(); fixmystreet.actionafterdrag.activate(); @@ -287,6 +293,11 @@ this.displayButtons(false); }, + onClickGoOffline: function(e) { + e.preventDefault(); + this.navigate('offline'); + }, + decrementDraftCount: function() { var counter = $('#view-my-reports .draft_count'); var count = counter.text(); |