Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 8060321

Browse files
committed
making sure the title tag gets updated *after* the history event happens
1 parent 3304177 commit 8060321

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

public/styleguide/js/url-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ var urlHandler = {
132132
document.getElementById("sg-viewport").contentWindow.postMessage( { "path": fileName }, urlHandler.targetOrigin);
133133
} else {
134134
var addressReplacement = (window.location.protocol == "file:") ? null : window.location.protocol+"//"+window.location.host+window.location.pathname.replace("index.html","")+"?p="+pattern;
135-
document.getElementById("title").innerHTML = "Pattern Lab - "+pattern;
136135
history.pushState(data, null, addressReplacement);
136+
document.getElementById("title").innerHTML = "Pattern Lab - "+pattern;
137137
}
138138
},
139139

@@ -163,8 +163,8 @@ var urlHandler = {
163163
iFramePath = "styleguide/html/styleguide.html";
164164
}
165165

166-
document.getElementById("title").innerHTML = "Pattern Lab - "+patternName;
167166
document.getElementById("sg-viewport").contentWindow.postMessage( { "path": iFramePath }, urlHandler.targetOrigin);
167+
document.getElementById("title").innerHTML = "Pattern Lab - "+patternName;
168168

169169
if (wsnConnected) {
170170
wsn.send( '{"url": "'+iFramePath+'", "patternpartial": "'+patternName+'" }' );

0 commit comments

Comments
 (0)