aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/js/views/around.js13
-rw-r--r--src/templates/en/around.html3
-rw-r--r--templates/around.html3
3 files changed, 18 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();
diff --git a/src/templates/en/around.html b/src/templates/en/around.html
index 47bc329..8a427e2 100644
--- a/src/templates/en/around.html
+++ b/src/templates/en/around.html
@@ -49,5 +49,8 @@
<a id="confirm-map" data-role="button" data-theme="a" class="map-bottom-btn">
Confirm Location
</a>
+ <a id="go-offline" data-role="button" data-theme="c" class="map-bottom-btn nodisplay">
+ Go Offline
+ </a>
</div>
diff --git a/templates/around.html b/templates/around.html
index 6fb6ca9..b4cd68c 100644
--- a/templates/around.html
+++ b/templates/around.html
@@ -49,5 +49,8 @@
<a id="confirm-map" data-role="button" data-theme="a" class="map-bottom-btn">
[% loc('Confirm Location') %]
</a>
+ <a id="go-offline" data-role="button" data-theme="c" class="map-bottom-btn nodisplay">
+ [% loc('Go Offline') %]
+ </a>
</div>