1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 04:27:59 +01:00

Make sure that the hint number is in the viewport

This commit is contained in:
Kris Maglione
2008-12-19 14:57:34 -05:00
parent 74700d3aff
commit f60ea76379
3 changed files with 51 additions and 43 deletions

View File

@@ -1201,8 +1201,8 @@ function Events() //{{{
// global escape handler, is called in ALL modes
onEscape: function ()
{
if (!modes.passNextKey)
{
if (modes.passNextKey)
return;
if (modes.passAllKeys)
{
modes.passAllKeys = false;
@@ -1247,7 +1247,6 @@ function Events() //{{{
modes.reset();
break;
}
}
},
// this keypress handler gets always called first, even if e.g.

View File

@@ -154,8 +154,8 @@ function Hints() //{{{
text = elem.textContent.toLowerCase();
span = baseNodeAbsolute.cloneNode(true);
span.style.left = (rect.left + scrollX) + "px";
span.style.top = (rect.top + scrollY) + "px";
span.style.left = Math.max((rect.left + scrollX), scrollX) + "px";
span.style.top = Math.max((rect.top + scrollY), scrollY) + "px";
fragment.appendChild(span);
pageHints.push([elem, text, span, null, elem.style.backgroundColor, elem.style.color]);

View File

@@ -311,6 +311,15 @@ const util = { //{{{
identity: function identity(k) k,
intersection: function (r1, r2) ({
get width() this.right - this.left,
get height() this.bottom - this.top,
left: Math.max(r1.left, r2.left),
right: Math.min(r1.right, r2.right),
top: Math.max(r1.top, r2.top),
bottom: Math.min(r1.bottom, r2.bottom)
}),
map: function map(obj, fn)
{
let ary = [];