mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 06:47:58 +01:00
Fix hints with body { position: relative; }
This commit is contained in:
@@ -273,6 +273,13 @@ function Hints() //{{{
|
|||||||
return [leftpos, toppos];
|
return [leftpos, toppos];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getBodyOffsets(doc)
|
||||||
|
{
|
||||||
|
let bodyRect = (doc.body || doc.documentElement).getBoundingClientRect();
|
||||||
|
return [doc.defaultView.scrollX - bodyRect.left,
|
||||||
|
doc.defaultView.scrollY - bodyRect.top];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the hints in a window.
|
* Generate the hints in a window.
|
||||||
*
|
*
|
||||||
@@ -288,8 +295,7 @@ function Hints() //{{{
|
|||||||
let doc = win.document;
|
let doc = win.document;
|
||||||
let height = win.innerHeight;
|
let height = win.innerHeight;
|
||||||
let width = win.innerWidth;
|
let width = win.innerWidth;
|
||||||
let scrollX = doc.defaultView.scrollX;
|
let [scrollX, scrollY] = getBodyOffsets(doc);
|
||||||
let scrollY = doc.defaultView.scrollY;
|
|
||||||
|
|
||||||
let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc);
|
let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc);
|
||||||
|
|
||||||
@@ -395,8 +401,7 @@ function Hints() //{{{
|
|||||||
|
|
||||||
for (let [,{ doc: doc, start: start, end: end }] in Iterator(docs))
|
for (let [,{ doc: doc, start: start, end: end }] in Iterator(docs))
|
||||||
{
|
{
|
||||||
let scrollX = doc.defaultView.scrollX;
|
let [scrollX, scrollY] = getBodyOffsets(doc);
|
||||||
let scrollY = doc.defaultView.scrollY;
|
|
||||||
|
|
||||||
inner:
|
inner:
|
||||||
for (let i in (util.interruptibleRange(start, end + 1, 500)))
|
for (let i in (util.interruptibleRange(start, end + 1, 500)))
|
||||||
|
|||||||
Reference in New Issue
Block a user