Merge pull request #123 from aidenybai/fix-popover
commit
a09974446d
@ -0,0 +1,12 @@
|
||||
import { router, navigate } from "https://unpkg.com/million@1.8.9-0/dist/router.mjs"
|
||||
|
||||
export const attachSPARouting = (draw) => {
|
||||
// SPA navigation for access later
|
||||
window.navigate = navigate
|
||||
// We only mutate document.title and content within .singlePage element
|
||||
router(".singlePage")
|
||||
// We need on initial load, then subsequent redirs
|
||||
// requestAnimationFrame() delays graph draw until SPA routing is finished
|
||||
window.addEventListener("million:navigate", () => requestAnimationFrame(draw))
|
||||
window.addEventListener("DOMContentLoaded", () => requestAnimationFrame(draw))
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{{if $.Site.Data.config.enableLinkPreview}}
|
||||
{{ $js := resources.Get "js/popover.js" | resources.Fingerprint "md5" | resources.Minify }}
|
||||
<script src="{{ $js.Permalink }}"></script>
|
||||
<script>
|
||||
initPopover({{strings.TrimRight "/" .Site.BaseURL }})
|
||||
</script>
|
||||
{{end}}
|
Loading…
Reference in New Issue