aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-01-21 22:55:55 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-01-21 22:55:55 +0000
commit60075da75ccd419026f8ac962bd2908871904818 (patch)
tree83f571c82a4a8043eff4529e5d56e57012e90158
parent285330ced08326c2780b9b455613c0df53915684 (diff)
Fix possible offline form issue & message spacing.
-rw-r--r--web/cobrands/fixmystreet/offline.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/web/cobrands/fixmystreet/offline.js b/web/cobrands/fixmystreet/offline.js
index 18d724e8c..a611cfec0 100644
--- a/web/cobrands/fixmystreet/offline.js
+++ b/web/cobrands/fixmystreet/offline.js
@@ -11,9 +11,9 @@ fixmystreet.offlineBanner = (function() {
function formText() {
var num = fixmystreet.offlineData.getForms().length;
if ( num === 1 ) {
- return num + translation_strings.offline.update_single;
+ return num + ' ' + translation_strings.offline.update_single;
} else {
- return num + translation_strings.offline.update_plural;
+ return num + ' ' + translation_strings.offline.update_plural;
}
}
@@ -338,12 +338,16 @@ fixmystreet.offline = (function() {
});
}
- $('#report_inspect_form').submit(function() {
+ // If we catch the form submit, e.g. Chrome still seems to
+ // try and submit and we get the Chrome offline error page
+ var btn = $('#report_inspect_form input[type=submit]');
+ btn.click(function() {
var data = $(this).serialize() + '&save=1&saved_at=' + Math.floor(+new Date() / 1000);
fixmystreet.offlineData.addForm(this.action, data);
location.href = '/my/planned?saved=1';
return false;
});
+ btn[0].type = 'button';
return true;
}