Fix broken drag scrolling when top is out of viewport
Addresses issue no. 390 #390
This commit is contained in:
parent
fd53ae0b48
commit
e9024292cd
@ -60,7 +60,12 @@ function bindMouseScrollYHandler(element, i) {
|
|||||||
|
|
||||||
function updateScrollTop(deltaY) {
|
function updateScrollTop(deltaY) {
|
||||||
var newTop = currentTop + (deltaY * i.railYRatio);
|
var newTop = currentTop + (deltaY * i.railYRatio);
|
||||||
var maxTop = i.scrollbarYRail.getBoundingClientRect().top + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight));
|
var scrollbarYTop = i.scrollbarYRail.getBoundingClientRect().top;
|
||||||
|
|
||||||
|
if(scrollbarYTop < 0) {
|
||||||
|
scrollbarYTop = 0;
|
||||||
|
}
|
||||||
|
var maxTop = scrollbarYTop + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight));
|
||||||
|
|
||||||
if (newTop < 0) {
|
if (newTop < 0) {
|
||||||
i.scrollbarYTop = 0;
|
i.scrollbarYTop = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user