aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/submit.js
diff options
context:
space:
mode:
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();
+ }
}
},