aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-01-29 10:52:53 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-01-29 10:53:14 +0000
commita1094544bb03fd18cda0e7885fd488ee633a9abc (patch)
tree42a6ed8b82f1d636922a1848d88c8f937428b5c7
parent0a1236b29bd0f22d7bdb112e08cef39de2a6cd4c (diff)
Fix saving of inspect form data offline.
-rw-r--r--CHANGELOG.md1
-rw-r--r--web/cobrands/fixmystreet/offline.js5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 485806de4..63d0e1933 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
- Check cached reports do still have photos before being shown. #2374
- Delete cache photos upon photo moderation. #2374
- Remove any use of `my $x if $foo`. #2377
+ - Fix saving of inspect form data offline.
* v2.5 (21st December 2018)
- Front end improvements:
diff --git a/web/cobrands/fixmystreet/offline.js b/web/cobrands/fixmystreet/offline.js
index a611cfec0..4d7c471aa 100644
--- a/web/cobrands/fixmystreet/offline.js
+++ b/web/cobrands/fixmystreet/offline.js
@@ -342,8 +342,9 @@ fixmystreet.offline = (function() {
// 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);
+ 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;
});