mirror of https://github.com/zer0bin-dev/zer0bin
test: 🧪 MutationObserver
This commit is contained in:
parent
db834b108f
commit
6ec8b47cfb
|
@ -75,7 +75,9 @@ tippy("#github-button", {
|
|||
allowHTML: true,
|
||||
})
|
||||
|
||||
window.addEventListener("popstate", () => {
|
||||
let observer = new MutationObserver(callback)
|
||||
|
||||
function callback() {
|
||||
let theme = ""
|
||||
|
||||
if (window.location.pathname == "/") {
|
||||
|
@ -92,4 +94,6 @@ window.addEventListener("popstate", () => {
|
|||
//@ts-ignore
|
||||
i._tippy.setProps({ theme: theme })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
observer.observe(document.getElementById("code-view-pre"))
|
||||
|
|
Loading…
Reference in New Issue