diff options
author | Erik Pellikka <erik@pellikka.org> | 2016-02-22 17:59:46 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-05-13 21:01:13 +0200 |
commit | e03a09d18928499cea626e2f5192a951fe851a3b (patch) | |
tree | 050942eee492ef40db75f449f76a88729f8ff4d1 /apps/files | |
parent | e383a9506df196e9421d3494b9f84ae28deea55d (diff) | |
download | nextcloud-server-e03a09d18928499cea626e2f5192a951fe851a3b.tar.gz nextcloud-server-e03a09d18928499cea626e2f5192a951fe851a3b.zip |
Add scrolling when dragging files
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/files.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 3b70e283749..daf762abb8c 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,24 @@ var dragOptions={ $selectedFiles = $(this); } $selectedFiles.closest('tr').fadeTo(250, 1).removeClass('dragging'); + }, + drag: function(event, ui) { + var currentScrollTop = $("#app-content").scrollTop(); + + var bottom = $(window).innerHeight() - 300; + var top = $(window).scrollTop() + 300; + if (event.pageY < top){ + $('html, body').animate({ + scrollTop: $("#app-content").scrollTop(currentScrollTop-=10) + },800); + } + if (event.pageY > bottom) + { + $('html, body').animate({ + scrollTop: $("#app-content").scrollTop(currentScrollTop+=10) + },800); + } + } }; // sane browsers support using the distance option |