fix: ReDoc removes path if site is using history API

closes #257
This commit is contained in:
Roman Hotsiy 2017-04-23 15:31:03 +03:00
parent 388b3d48d5
commit c77e1a28f7
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -30,7 +30,7 @@ export class Hash {
update(hash: string|null, rewriteHistory:boolean = false) { update(hash: string|null, rewriteHistory:boolean = false) {
if (hash == undefined) return; if (hash == undefined) return;
if (rewriteHistory) { if (rewriteHistory) {
window.history.replaceState(null, '', '#' + hash); window.history.replaceState(null, '', window.location.href.split("#")[0] + '#' + hash);
return; return;
} }
this.noEmit = true; this.noEmit = true;