diff options
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 48ae83103..c26b10d29 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -1285,9 +1285,13 @@ fixmystreet.update_pin = function(lonlat, savePushState) { if (savePushState !== false) { if ('pushState' in history) { var newReportUrl = '/report/new?longitude=' + lonlats.url.lon + '&latitude=' + lonlats.url.lat; - history.pushState({ - newReportAtLonlat: lonlats.state - }, null, newReportUrl); + var newState = { newReportAtLonlat: lonlats.state }; + // If we're already in the reporting place, we want to replace state, it's a pin move + if (fixmystreet.page === 'new') { + history.replaceState(newState, null, newReportUrl); + } else { + history.pushState(newState, null, newReportUrl); + } } } |