1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 02:28:00 +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

@@ -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]);