fix(navigation): not updating style and background image
This commit is contained in:
parent
8f86a7299d
commit
40fe301b54
1 changed files with 1 additions and 4 deletions
5
index.ts
5
index.ts
|
@ -23,10 +23,7 @@ function changePage(href: string) {
|
||||||
const doc = new DOMParser().parseFromString(html, "text/html")
|
const doc = new DOMParser().parseFromString(html, "text/html")
|
||||||
window.history.pushState({}, "", href)
|
window.history.pushState({}, "", href)
|
||||||
document.title = doc.title
|
document.title = doc.title
|
||||||
const distMain = doc.querySelector("main")
|
document.body = doc.body
|
||||||
const currentMain = document.querySelector("main")
|
|
||||||
if (distMain === null || currentMain === null) document.body = doc.body
|
|
||||||
else currentMain.innerHTML = distMain.innerHTML
|
|
||||||
setupEvents()
|
setupEvents()
|
||||||
scrollTo({
|
scrollTo({
|
||||||
top: 0,
|
top: 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue