aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/views/offline.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/www/js/views/offline.js b/www/js/views/offline.js
index d2af4e0..26b3fdb 100644
--- a/www/js/views/offline.js
+++ b/www/js/views/offline.js
@@ -1,10 +1,11 @@
(function (FMS, Backbone, _, $) {
_.extend( FMS, {
- OfflineView: FMS.FMSView.extend({
+ OfflineView: FMS.LocatorView.extend({
template: 'offline',
id: 'offline',
prev: 'home',
next: 'reports',
+ skipLocationCheck: true,
events: {
'pagehide': 'destroy',
@@ -13,7 +14,24 @@
'click .ui-btn-right': 'onClickButtonNext',
'click #id_photo_button': 'takePhoto',
'click #id_existing': 'addPhoto',
- 'click #id_del_photo_button': 'deletePhoto'
+ 'click #id_del_photo_button': 'deletePhoto',
+ 'click #locate': 'locate'
+ },
+
+ failedLocation: function(details) {
+ this.finishedLocating();
+ this.locateCount = 21;
+
+ $('#locate_result').html('Could not get position');
+ },
+
+ gotLocation: function(info) {
+ this.finishedLocating();
+
+ this.model.set('lat', info.coordinates.latitude);
+ this.model.set('lon', info.coordinates.longitude);
+
+ $('#locate_result').html('Got position (' + info.coordinates.latitude + ', ' + info.coordinates.longitude + ')');
},
takePhoto: function() {