added back the jquery animations

This commit is contained in:
Erik Pellikka 2016-02-23 09:56:05 -05:00 committed by Morris Jobke
parent 4e5f37a05d
commit 5dbb549bbe
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 11 additions and 6 deletions

View File

@ -403,15 +403,20 @@ var dragOptions={
drag: function(event, ui) {
var scrollingArea = FileList.$container;
var currentScrollTop = $(scrollingArea).scrollTop();
var scrollArea = Math.min(Math.floor($(window).innerHeight()/2), 100);
var scrollArea = Math.min(Math.floor($(window).innerHeight() / 2), 100);
var bottom = $(window).innerHeight() - scrollArea;
var top = $(window).scrollTop() + scrollArea;
if (event.pageY < top){
$(scrollingArea).scrollTop(currentScrollTop - 10);
}
else if (event.pageY > bottom) {
$(scrollingArea).scrollTop(currentScrollTop + 10);
if (event.pageY < top) {
$('html, body').animate({
scrollTop: $(scrollingArea).scrollTop(currentScrollTop - 10)
}, 400);
} else if (event.pageY > bottom) {
$('html, body').animate({
scrollTop: $(scrollingArea).scrollTop(currentScrollTop + 10)
}, 400);
}
}