fix: toggle top progress bar

This commit is contained in:
EnixCoda 2019-11-19 15:07:22 +08:00
parent 5c617aa374
commit 44454152ea
No known key found for this signature in database
GPG key ID: FE06F5DFC1C9B8E4

View file

@ -129,6 +129,9 @@ const pjax = new PJAX({
forceCache: true, // TODO: merge namespace, add forceCache
})
window.addEventListener('pjax:send', () => mountTopProgressBar())
window.addEventListener('pjax:complete', () => unmountTopProgressBar())
export function loadWithPJAX(URL: string) {
mountTopProgressBar()
pjax.loadUrl(URL, { scrollTo: 0 })