Avoids jumping if window is smaller than 300 pixels in height
* divides the area where the scroll should be triggered by 2 * uses the minimum value of the above and 300
This commit is contained in:
parent
e03a09d189
commit
5711e88093
1 changed files with 3 additions and 2 deletions
|
@ -402,9 +402,10 @@ var dragOptions={
|
|||
},
|
||||
drag: function(event, ui) {
|
||||
var currentScrollTop = $("#app-content").scrollTop();
|
||||
var scrollArea = Math.min(Math.floor($(window).innerHeight()/2), 300);
|
||||
|
||||
var bottom = $(window).innerHeight() - 300;
|
||||
var top = $(window).scrollTop() + 300;
|
||||
var bottom = $(window).innerHeight() - scrollArea;
|
||||
var top = $(window).scrollTop() + scrollArea;
|
||||
if (event.pageY < top){
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#app-content").scrollTop(currentScrollTop-=10)
|
||||
|
|
Loading…
Reference in a new issue