aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/views/around.js1
-rw-r--r--www/js/views/details.js15
-rw-r--r--www/js/views/photo.js2
3 files changed, 15 insertions, 3 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js
index 23d7882..28bca31 100644
--- a/www/js/views/around.js
+++ b/www/js/views/around.js
@@ -159,6 +159,7 @@
this.model.set('lat', info.coordinates.latitude );
this.model.set('lon', info.coordinates.longitude );
this.model.set('categories', info.details.category );
+ FMS.saveCurrentDraft();
this.navigate( 'photo' );
},
diff --git a/www/js/views/details.js b/www/js/views/details.js
index 79bd886..6fc3f3e 100644
--- a/www/js/views/details.js
+++ b/www/js/views/details.js
@@ -6,10 +6,18 @@
prev: 'photo',
next: 'submit-email',
+ events: {
+ 'pagehide': 'destroy',
+ 'pageshow': 'afterDisplay',
+ 'click .ui-btn-left': 'onClickButtonPrev',
+ 'click .ui-btn-right': 'onClickButtonNext',
+ 'change textarea': 'updateCurrentReport',
+ 'change select': 'updateCurrentReport',
+ 'blur input': 'updateCurrentReport'
+ },
+
onClickButtonPrev: function() {
- this.model.set('title', $('#form_title').val());
- this.model.set('details', $('#form_detail').val());
- this.model.set('category', $('#form_category').val());
+ this.updateCurrentReport();
this.navigate( this.prev );
},
@@ -44,6 +52,7 @@
this.model.set('category', $('#form_category').val());
this.model.set('title', $('#form_title').val());
this.model.set('details', $('#form_detail').val());
+ FMS.saveCurrentDraft();
}
})
});
diff --git a/www/js/views/photo.js b/www/js/views/photo.js
index 5d451af..24a5070 100644
--- a/www/js/views/photo.js
+++ b/www/js/views/photo.js
@@ -29,6 +29,7 @@
addPhotoSuccess: function(imgURI) {
$('#photo').attr('src', imgURI );
this.model.set('file', imgURI);
+ FMS.saveCurrentDraft();
$('#display_photo').show();
$('#add_photo').hide();
@@ -44,6 +45,7 @@
deletePhoto: function() {
this.model.set('file', '');
+ FMS.saveCurrentDraft();
$('#photo').attr('src', '');
$('#display_photo').hide();