Fix bug where scrolling up wouldn't show if it was offscreen

This commit is contained in:
Nick Krichevsky 2015-02-28 11:58:35 -05:00
parent bc92b31cb3
commit 4010bc32d4

View file

@ -500,7 +500,10 @@ document.addEventListener('DOMContentLoaded', function() {
//Scroll if the tab index passes the top border.
if (tabList[tabKeyIndex].getBoundingClientRect().top<=0){
scrollBy(0, tabList[tabKeyIndex].clientHeight*-1);
}
}
else if (tabKeyIndex>=0 && tabList[tabKeyIndex].getBoundingClientRect().bottom>=document.querySelector('body').clientHeight){
scrollTo(0, tabList[tabKeyIndex].getBoundingClientRect().bottom);
}
}
//If enter is pressed, switch to the tab.
else if (event.keyCode===13){