aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-12-14 14:18:15 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-12-14 14:18:17 +0000
commitae388229af9d825d1a564c9c317756e9af76b873 (patch)
tree115ea9efdd3b3e3085beda9b473f362c03b190cc /web
parent9c30377ff2c7930771b6c9be10f5a4f24456be0b (diff)
Make sure map state stored if filters used first.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 100eec15d..b94e6e813 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1025,11 +1025,12 @@ $.extend(fixmystreet.set_up, {
if (fixmystreet.page.match(/reports|around|my/)) {
around_map_state = fixmystreet.maps.get_map_state();
- // Preserve the current map state in the initial state so we can
+ // Preserve the current map state in the current state so we can
// restore it if the user navigates back. This needs doing here,
// rather than the 'fake history' replaceState call that sets the
// initial state, because the map hasn't been loaded at that point.
- if ('state' in history && history.state.initial) {
+ // Also, filters might be changed before a report click.
+ if ('state' in history && !history.state.mapState) {
history.state.mapState = around_map_state;
// NB can't actually modify current state directly, needs a
// call to replaceState()