Merge pull request #14301 from nextcloud/backport/14300/stable15

[stable15] Use proper scroll container when dragging files
This commit is contained in:
Roeland Jago Douma 2019-02-20 15:27:16 +01:00 committed by GitHub
commit bb26c2628d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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