mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
"footnotes" -> ".footnotes"; use idFromHash()
This commit is contained in:
@@ -152,11 +152,11 @@
|
||||
document.addEventListener("click", (ev) =>
|
||||
{
|
||||
if (!(ev.target && ev.target instanceof HTMLAnchorElement)) return;
|
||||
if (!ev.target.matches(".footnotes .reversefootnote, .footnotes .footnoteBackLink, footnotes .footnote-return")) return;
|
||||
const hash = ev.target.hash;
|
||||
if (!hash) return;
|
||||
const fnref = document.getElementById(hash.substring(1));
|
||||
|
||||
if (!ev.target.matches(".footnotes .reversefootnote, .footnotes .footnoteBackLink, .footnotes .footnote-return")) return;
|
||||
const id = idFromHash(ev.target);
|
||||
if (!id) return;
|
||||
const fnref = document.getElementById(id);
|
||||
|
||||
window.scrollTo({ top: fnref.getBoundingClientRect().top + window.scrollY });
|
||||
ev.preventDefault();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user