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:
@@ -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));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user