1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 03:55:46 +01:00

Fix itemlist scrolling changes in revision 1e95cff03040.

This commit is contained in:
Kris Maglione
2010-09-24 17:38:25 -04:00
parent 6e0aa6a23b
commit 0c34437805
2 changed files with 5 additions and 5 deletions

View File

@@ -668,11 +668,11 @@ const Util = Module("Util", {
*
* @param {Node} elem The element to make visible.
*/
scrollIntoView: function scrollIntoView(elem) {
scrollIntoView: function scrollIntoView(elem, alignWithTop) {
let win = elem.ownerDocument.defaultView;
let rect = elem.getBoundingClientRect();
if (!(rect && rect.top < win.innerHeight && rect.bottom >= 0 && rect.left < win.innerWidth && rect.right >= 0))
elem.scrollIntoView();
if (!(rect && rect.bottom <= win.innerHeight && rect.top >= 0 && rect.right <= win.innerWidth && rect.left >= 0))
elem.scrollIntoView(arguments.length > 1 ? alignWithTop : Math.abs(rect.top) < Math.abs(win.innerHeight - rect.bottom));
},
/**