]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow dropping files on the table container
authorVincent Petry <pvince81@owncloud.com>
Mon, 12 Jan 2015 11:29:26 +0000 (12:29 +0100)
committerVincent Petry <pvince81@owncloud.com>
Mon, 12 Jan 2015 11:29:26 +0000 (12:29 +0100)
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.

apps/files/js/filelist.js

index 2027f62aa025a6a474d906a1534c8463750d1859..d6d5bcf912e0df1bf020dfd0b30d2641934fa0a2 100644 (file)
                        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;
                                }