On Page load use replaceState instead of pushState

Fix T50797 and replace the id-based url with a custom url for page in the browser's history.
This commit is contained in:
Francesco Siddi 2017-02-27 13:08:56 +01:00
parent 6765276519
commit e381ca774e

View File

@ -34,11 +34,10 @@ script.
// skip the project-level displayNode push.
var url = '{{ node.properties.url }}'
var push_state = {nodeId: '{{node._id}}', url: url};
// console.log('Pushing state ', push_state, ' with URL ', push_url);
window.history.pushState(
push_state,
'{{node.properties.url}}',
var replace_state = {nodeId: '{{node._id}}', url: url};
window.history.replaceState(
replace_state,
'{{node.name}}',
url
);
// Generate GA pageview