aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/map-OpenLayers.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/map-OpenLayers.js')
-rw-r--r--www/js/map-OpenLayers.js32
1 files changed, 20 insertions, 12 deletions
diff --git a/www/js/map-OpenLayers.js b/www/js/map-OpenLayers.js
index c5fbe59..57fb9e9 100644
--- a/www/js/map-OpenLayers.js
+++ b/www/js/map-OpenLayers.js
@@ -248,18 +248,26 @@ $(document).delegate('#submit-problem', 'pageshow', function(event) {
$('#pc').val(localStorage.pc);
$('#fixmystreet\\.latitude').val(localStorage.latitude);
$('#fixmystreet\\.longitude').val(localStorage.longitude);
- $.getJSON( CONFIG.FMS_URL + 'report/new/ajax', {
- latitude: $('#fixmystreet\\.latitude').val(),
- longitude: $('#fixmystreet\\.longitude').val()
- }, function(data) {
- if (data.error) {
- // XXX If they then click back and click somewhere in the area, this error will still show.
- $('#side-form').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>');
- return;
- }
- $('#councils_text').html(data.councils_text);
- $('#form_category_row').html(data.category);
- });
+ if ( !localStorage.offline ) {
+ $.getJSON( CONFIG.FMS_URL + 'report/new/ajax', {
+ latitude: $('#fixmystreet\\.latitude').val(),
+ longitude: $('#fixmystreet\\.longitude').val()
+ }, function(data) {
+ if (data.error) {
+ // XXX If they then click back and click somewhere in the area, this error will still show.
+ $('#side-form').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>');
+ return;
+ }
+ $('#councils_text').html(data.councils_text);
+ $('#form_category_row').html(data.category);
+ });
+ } else {
+ $('#councils_text').html("You are currently operating in offline mode so you can save the details of the problem but you'll need to finish reporting when you have internet access.");
+ $('#form_category_row').hide();
+ $('#email_label').hide();
+ $('#form_email').hide();
+ $('#form_sign_in').hide();
+ }
});
function show_map(event) {