diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-15 13:23:25 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-16 17:31:07 +0100 |
commit | 67712d728fa89f8e30eeff40744642595b8e56dc (patch) | |
tree | 270237f10a259415b0f659437752211fa3d3b2e6 | |
parent | 5886ac658a4d7038a1530a99ff301c3e73ea7fa6 (diff) |
Only set Back link when first report pulled in.
Otherwise subsequent report views set the Back link to a report URI, so
clicking it goes back to the list but with an incorrect address.
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index ba93a6995..dfd0b5ffd 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -943,14 +943,15 @@ fixmystreet.display = { // If this is the first individual report we've loaded, remove the // "all reports" sub_map_links but store them in a global variable // so we can reinsert them when the user returns to the all reports - // view. With #sub_map_links detached from the DOM, we set up the - // individual report's sub_map_links using map_controls(). + // view. Also set the Back link to know where to go back to. if (!fixmystreet.original.sub_map_links) { fixmystreet.original.sub_map_links = $('#sub_map_links').detach(); + $('.js-back-to-report-list').attr('href', location.href); } + // With #sub_map_links detached from the DOM, we set up the + // individual report's sub_map_links using map_controls(). fixmystreet.set_up.map_controls(); - $('.js-back-to-report-list').attr('href', location.href); // Problems nearby should act the same as 'Back to all reports' on around, // but on /my and /reports should go to that around page. if (fixmystreet.original.page == 'around') { |