summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-20 16:19:01 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-20 16:19:01 +0200
commit59a85a4c76b80658d9373e3acf4f71b872b244a0 (patch)
treee405600b3531a340bb422738739eea351cb064c9 /apps
parent94ad54ec9b96d41a614fbbad4a97b34c41a6901f (diff)
parent5dbb549bbea8e555543dd50ca7688d8486057f5f (diff)
downloadnextcloud-server-59a85a4c76b80658d9373e3acf4f71b872b244a0.tar.gz
nextcloud-server-59a85a4c76b80658d9373e3acf4f71b872b244a0.zip
Merge pull request #22576 from owncloud/folder_scroll_fix
Add scrolling when dragging files. Fixes #12329
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/files.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 3b70e283749..8542bd50476 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -385,6 +385,7 @@ var dragOptions={
cursorAt: { left: 24, top: 18 },
helper: createDragShadow,
cursor: 'move',
+
start: function(event, ui){
var $selectedFiles = $('td.filename input:checkbox:checked');
if (!$selectedFiles.length) {
@@ -398,6 +399,26 @@ var dragOptions={
$selectedFiles = $(this);
}
$selectedFiles.closest('tr').fadeTo(250, 1).removeClass('dragging');
+ },
+ drag: function(event, ui) {
+ var scrollingArea = FileList.$container;
+ 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)
+ }, 400);
+
+ } else if (event.pageY > bottom) {
+ $('html, body').animate({
+ scrollTop: $(scrollingArea).scrollTop(currentScrollTop + 10)
+ }, 400);
+ }
+
}
};
// sane browsers support using the distance option