mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-12-21 07:31:58 +01:00
update hash change thing
This commit is contained in:
parent
235dba9f01
commit
64524f76e4
@ -110,12 +110,12 @@
|
|||||||
<script src="assets/bootstrap-toc.min.js"></script>
|
<script src="assets/bootstrap-toc.min.js"></script>
|
||||||
<!-- convenence script -->
|
<!-- convenence script -->
|
||||||
<script>
|
<script>
|
||||||
addEventListener("hashchange", e => {
|
addEventListener("hashchange", () => {
|
||||||
var q = document.querySelector(location.hash)
|
var q = document.querySelector(location.hash)
|
||||||
if (q instanceof HTMLHeadingElement && q.parentElement.parentElement instanceof HTMLDetailsElement) {
|
if (q instanceof HTMLHeadingElement && q.parentElement.parentElement instanceof HTMLDetailsElement)
|
||||||
q.parentElement.parentElement.open = true;
|
q.parentElement.parentElement.open = true;
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
if (location.hash) requestAnimationFrame(() => dispatchEvent(new HashChangeEvent("hashchange")));
|
||||||
if ('IntersectionObserver' in self) {
|
if ('IntersectionObserver' in self) {
|
||||||
const mo = new IntersectionObserver(i => {
|
const mo = new IntersectionObserver(i => {
|
||||||
for (const s of i) {
|
for (const s of i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user