aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/views/submit.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-09-19 16:15:39 +0100
committerStruan Donald <struan@exo.org.uk>2013-09-19 16:15:39 +0100
commitdc17aa4c0e22cf7af2564c978ec2d19559c2d66d (patch)
treed294cf170b29f7f307156a1a3dbd8d0e52c3cf79 /src/js/views/submit.js
parentd7e747708ae27459a831649098830619372e16eb (diff)
Save the current user as we go
This means that if something happens to interrupt the reporting process then any user details entered are not frustrating lost. Fixes #140
Diffstat (limited to 'src/js/views/submit.js')
-rw-r--r--src/js/views/submit.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/js/views/submit.js b/src/js/views/submit.js
index 6cf75bb..80ed6f1 100644
--- a/src/js/views/submit.js
+++ b/src/js/views/submit.js
@@ -217,6 +217,7 @@
e.preventDefault();
if ( this.validate() ) {
FMS.currentUser.set('email', $('#form_email').val());
+ FMS.currentUser.save();
this.navigate( 'submit-name' );
}
},
@@ -285,6 +286,10 @@
if ( this.model.get('title_list') && this.model.get('title_list').length > 0 ) {
FMS.currentUser.set('title', $('#form_title').val());
}
+
+ if ( FMS.currentUser ) {
+ FMS.currentUser.save();
+ }
}
})
});
@@ -345,6 +350,7 @@
this.model.set('may_show_name', $('#form_may_show_name').is(':checked'));
FMS.currentUser.set('name', $('#form_name').val());
FMS.currentUser.set('may_show_name', $('#form_may_show_name').is(':checked'));
+ FMS.currentUser.save();
} else {
// if this is set then we are registering a password
if ( ! this.model.get('submit_clicked') ) {