aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-01-12 12:29:26 +0100
committerVincent Petry <pvince81@owncloud.com>2015-01-12 12:29:26 +0100
commit512ba327f76aae0832c8e338acebcbdd6a661def (patch)
treec4d2bbbe9ee42a0fe9d8934eb7924c7ef4814336 /apps/files/js
parentddf81c2ed988ddce244fd60c2a3a08027e9c228e (diff)
downloadnextcloud-server-512ba327f76aae0832c8e338acebcbdd6a661def.tar.gz
nextcloud-server-512ba327f76aae0832c8e338acebcbdd6a661def.zip
Allow dropping files on the table container
Make it possible to drop files below the table even if the table is smaller than the window height. Added a check to make sure upload is not triggered on invisible lists.
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 2027f62aa02..d6d5bcf912e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1832,9 +1832,18 @@
fileUploadStart.on('fileuploaddrop', function(e, data) {
OC.Upload.log('filelist handle fileuploaddrop', e, data);
+ if (self.$el.hasClass('hidden')) {
+ // do not upload to invisible lists
+ return false;
+ }
+
var dropTarget = $(e.originalEvent.target);
// check if dropped inside this container and not another one
- if (dropTarget.length && !self.$el.is(dropTarget) && !self.$el.has(dropTarget).length) {
+ if (dropTarget.length
+ && !self.$el.is(dropTarget) // dropped on list directly
+ && !self.$el.has(dropTarget).length // dropped inside list
+ && !dropTarget.is(self.$container) // dropped on main container
+ ) {
return false;
}