aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-07-13 22:29:14 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-14 01:06:11 +0100
commitf61b6d3be37074f3bbe543bf291865e550572040 (patch)
tree4e419361c5e017d462820a679115f56d78359dea
parent9af82f84b1cbdecca0fdf9c2d8a0067771cd461b (diff)
Only set document.title after any pushState call.
pushState stores the title at the time for e.g. the Back dropdown.
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index c74ae1ba2..43954a1cc 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -896,7 +896,6 @@ fixmystreet.display = {
var found = html.match(/<title>([\s\S]*?)<\/title>/);
var page_title = found[1];
- document.title = page_title;
fixmystreet.page = 'report';
fixmystreet.mobile_reporting.remove_ui();
@@ -937,6 +936,7 @@ fixmystreet.display = {
if (typeof callback === 'function') {
callback();
}
+ document.title = page_title;
} else {
window.location.href = reportPageUrl;
@@ -959,7 +959,6 @@ fixmystreet.display = {
$('body').removeClass('with-notes');
- document.title = fixmystreet.original.title;
fixmystreet.page = fixmystreet.original.page;
if ($('html').hasClass('mobile') && fixmystreet.page == 'around') {
$('#mob_sub_map_links').remove();
@@ -981,6 +980,7 @@ fixmystreet.display = {
if (typeof callback === 'function') {
callback();
}
+ document.title = fixmystreet.original.title;
} else {
window.location.href = reportListUrl;