aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-04-25 12:42:02 +0100
committerStruan Donald <struan@exo.org.uk>2013-04-25 12:42:02 +0100
commitfcee03229f60716e1924d3e73e0279311c79e356 (patch)
treeacca1ec64002fa0560e9573750f73291e65094f8 /www/js
parent94b49a9b5720bf7e8796806a34da0617fba6ad28 (diff)
if app is goes offline while on the map then save the location of the
report even though it might not be a valid location as it's more annoying for the user to lose the location altogether
Diffstat (limited to 'www/js')
-rw-r--r--www/js/views/around.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js
index f1fb175..bd12933 100644
--- a/www/js/views/around.js
+++ b/www/js/views/around.js
@@ -138,6 +138,13 @@
var position = this.getCrossHairPosition();
if ( FMS.isOffline ) {
+ this.stopListening(FMS.locator);
+ FMS.locator.stopTracking();
+ // these may be out of the area but lets just save them
+ // for now and they can be checked when we are online.
+ this.model.set('lat', position.lat );
+ this.model.set('lon', position.lon );
+ FMS.saveCurrentDraft();
this.navigate( 'offline' );
} else {
this.listenTo(FMS.locator, 'gps_located', this.goPhoto);