aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-01-20 11:20:33 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-02-14 10:38:49 +0000
commitf0edab7ee84e4358c279a5a8ec37dbb0ae8f1b3d (patch)
tree31c48380001dcdb6774cfce0de1d8d6b8e42d78c /web
parent319ee3984857482389772d6f8db4a3044b31cf50 (diff)
Catch POST in service worker, not by rewriting button.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/offline.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/web/cobrands/fixmystreet/offline.js b/web/cobrands/fixmystreet/offline.js
index 1c5d36eda..908326a69 100644
--- a/web/cobrands/fixmystreet/offline.js
+++ b/web/cobrands/fixmystreet/offline.js
@@ -145,15 +145,6 @@ fixmystreet.offlineData = (function() {
getForms: function() {
return getData().then(function(data) { return data.forms; });
},
- addForm: function(action, formData) {
- updateData(function(data) {
- var forms = data.forms;
- if (!forms.length || formData != forms[forms.length - 1][1]) {
- forms.push([action, formData]);
- }
- fixmystreet.offlineBanner.update();
- });
- },
shiftForm: function(idx) {
updateData(function(data) {
data.forms.shift();
@@ -328,20 +319,6 @@ fixmystreet.offline = (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 form = $(this).closest('form');
- var data = form.serialize() + '&save=1&saved_at=' + Math.floor(+new Date() / 1000);
- fixmystreet.offlineData.addForm(form.attr('action'), data);
- location.href = '/my/planned?saved=1';
- return false;
- });
- btn[0].type = 'button';
-
- return true;
}
return {