aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/js/models/report.js6
-rw-r--r--src/js/views/submit.js4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/js/models/report.js b/src/js/models/report.js
index 85d6e93..477d16c 100644
--- a/src/js/models/report.js
+++ b/src/js/models/report.js
@@ -100,8 +100,10 @@
}
if ( data.success ) {
that.trigger('sync', that, data, options);
- } else {
+ } else if ( data.errors ) {
that.trigger('invalid', that, data, options);
+ } else {
+ that.trigger('error', that, FMS.strings.report_send_error, options);
}
} else {
that.trigger('error', that, FMS.strings.report_send_error, options);
@@ -141,7 +143,7 @@
},
error: function (data, status, errorThrown ) {
console.log(FMS.strings.report_send_error);
- options.error( data, status, errorThrown );
+ that.trigger('error', that, data, status, errorThrown );
}
} );
}
diff --git a/src/js/views/submit.js b/src/js/views/submit.js
index 9be6c68..ea36492 100644
--- a/src/js/views/submit.js
+++ b/src/js/views/submit.js
@@ -97,9 +97,9 @@
onReportError: function(model, err, options) {
if ( err.errors ) {
- alert( FMS.strings.sync_error + ': ' + err.errors);
+ navigator.notification.alert( FMS.strings.sync_error + ': ' + err.errors, null, 'FixMyStreet' );
} else {
- alert( FMS.strings.unknown_sync_error );
+ navigator.notification.alert( FMS.strings.unknown_sync_error, null, 'FixMyStreet' );
}
},