diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-02-23 10:47:38 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-05-13 21:01:13 +0200 |
commit | 5711e880933876f03178d6ec067a28d7dd4d5c6b (patch) | |
tree | cfe721644b81fb922a8c43e026211c46ff32bdc6 /apps/files/js/files.js | |
parent | e03a09d18928499cea626e2f5192a951fe851a3b (diff) | |
download | nextcloud-server-5711e880933876f03178d6ec067a28d7dd4d5c6b.tar.gz nextcloud-server-5711e880933876f03178d6ec067a28d7dd4d5c6b.zip |
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
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index daf762abb8c..9af9592929a 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -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) |