aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/submit.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-04-18 11:50:52 +0100
committerStruan Donald <struan@exo.org.uk>2013-04-18 11:57:55 +0100
commita78194a0aa6fab68e82dc035f2f95281a653265f (patch)
tree6d6f57174b2919ac0031bf1f2363d921e8730cd1 /www/js/views/submit.js
parent4927e38eb8f108d4e910e691f593bca4992fb28f (diff)
display a save for later page if between starting the report and
submitting it we have gone offline
Diffstat (limited to 'www/js/views/submit.js')
-rw-r--r--www/js/views/submit.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/www/js/views/submit.js b/www/js/views/submit.js
index 27b21f7..09231be 100644
--- a/www/js/views/submit.js
+++ b/www/js/views/submit.js
@@ -35,10 +35,14 @@
if ( this.validate() ) {
this.model.set('user', FMS.currentUser);
- this.report = new FMS.Report( this.model.toJSON() );
- this.listenTo( this.report, 'sync', this.onReportSync );
- this.listenTo( this.report, 'error', this.onReportError );
- this.report.save();
+ if ( FMS.isOffline ) {
+ this.navigate( 'save_offline' );
+ } else {
+ this.report = new FMS.Report( this.model.toJSON() );
+ this.listenTo( this.report, 'sync', this.onReportSync );
+ this.listenTo( this.report, 'error', this.onReportError );
+ this.report.save();
+ }
}
},