1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 06:57:59 +01:00

Fix accessing help topics on the current help page.

Only those beneath the current page position were accessible.
This commit is contained in:
Doug Kearns
2009-03-04 17:10:20 +11:00
parent 8e85219443
commit 1e7158b397

View File

@@ -6,7 +6,7 @@ function checkFragment()
return;
let elem = document.evaluate('//*[@class="tag" and text()="' + frag + '"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0);
if (elem)
window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context
window.content.scrollTo(0, window.content.scrollY + elem.getBoundingClientRect().top - 10); // 10px context
}
document.addEventListener("load", checkFragment, true);