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.
This commit is contained in:
Vincent Petry 2015-01-12 12:29:26 +01:00
parent ddf81c2ed9
commit 512ba327f7
1 changed files with 10 additions and 1 deletions

View File

@ -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;
}