diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-10-21 19:59:05 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-10-21 20:21:14 +0100 |
commit | e12e5a7685b4ae5dcfeaf931adde2dbb91ef745f (patch) | |
tree | 733f0a5c2d31a79addc6f03eafb2a581980099dc /web/js | |
parent | 1ae102a9f4ebddb4a94b9fd8094ec47c57f7ad00 (diff) |
Store and use initial URL to fix JavaScript bugs.
If you were on a body page, selected a report, then another report, the
"Back to all reports" link then had an incorrect URL. Also, going "Back
to all reports" after one report would fetch an incorrect Ajax query of
reports to show (as the URL had not yet been updated).
Both of these are fixed by storing the URL on page load, and using that
for the "Back to all reports" link and the URL used by the Ajax call.
There is still an issue with the URL shown if you filter, then select a
report, then click "Back to all reports", but the contents are okay.
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/map-OpenLayers.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 553823818..afe47b4e7 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -435,7 +435,7 @@ var fixmystreet = fixmystreet || {}; if (fixmystreet.page == 'reports' || fixmystreet.page == 'my') { pin_layer_options.strategies = [ new OpenLayers.Strategy.FixMyStreetFixed() ]; pin_layer_options.protocol = new OpenLayers.Protocol.FixMyStreet({ - url: '?ajax=1', + url: fixmystreet.original.href.split('?')[0] + '?ajax=1', format: new OpenLayers.Format.FixMyStreet() }); } |