]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix dropping files below the table
authorVincent Petry <pvince81@owncloud.com>
Thu, 22 May 2014 09:16:42 +0000 (11:16 +0200)
committerVincent Petry <pvince81@owncloud.com>
Thu, 22 May 2014 09:16:42 +0000 (11:16 +0200)
apps/files/css/files.css
apps/files/js/filelist.js
apps/files/templates/index.php
apps/files/tests/js/filelistSpec.js

index 009cb355ba7d33a01720539900ca3c2f5c5c17c3..e397d27e83bdc59fb67c1bce3d9c8af4a620afe7 100644 (file)
        position: relative;
 }
 
+/* fit app list view heights */
+.app-files #app-content>.viewcontainer {
+       height: 100%;
+}
+
 /**
  * Override global #controls styles
  * to be more flexible / relative
index 3d107c7ca7a55188327d3b1a8d95ecd514c02012..9f6840eab1339536716f497162fc97a95a9ae45e 100644 (file)
                        fileUploadStart.on('fileuploaddrop', function(e, data) {
                                OC.Upload.log('filelist handle fileuploaddrop', e, data);
 
-
                                var dropTarget = $(e.originalEvent.target);
-                               // check if dropped inside this list and not another one
-                               if (dropTarget.length && !self.$el.has(dropTarget).length) {
+                               // check if dropped inside this container and not another one
+                               if (dropTarget.length && !self.$el.is(dropTarget) && !self.$el.has(dropTarget).length) {
                                        return false;
                                }
 
index 8cab4ce220b864523a5b898fb98383574aa7b306..b52effb1e7808dadb5776cc4848f129f29ccd75b 100644 (file)
@@ -2,7 +2,7 @@
 <?php $_['appNavigation']->printPage(); ?>
 <div id="app-content">
        <?php foreach ($_['appContents'] as $content) { ?>
-       <div id="app-content-<?php p($content['id']) ?>" class="hidden">
+       <div id="app-content-<?php p($content['id']) ?>" class="hidden viewcontainer">
        <?php print_unescaped($content['content']) ?>
        </div>
        <?php } ?>
index e5bbf0f0fb8b4b6245ff9a698c61a20e3c8ae03e..61a0dc31295f46d1522293d2ec3dca2060fe95d3 100644 (file)
@@ -1730,7 +1730,7 @@ describe('OCA.Files.FileList tests', function() {
                                ev = dropOn($anotherTable.find('.crumb'));
                                expect(ev.result).toEqual(false);
                        });
-                       it('drop on an element outside file list does not trigger upload', function() {
+                       it('drop on an element outside file list container does not trigger upload', function() {
                                var $anotherEl = $('<div>outside</div>');
                                var ev;
                                $('#testArea').append($anotherEl);
@@ -1744,6 +1744,12 @@ describe('OCA.Files.FileList tests', function() {
 
                                expect(ev.result).not.toEqual(false);
                        });
+                       it('drop on an element on the table container triggers upload', function() {
+                               var ev;
+                               ev = dropOn($('#app-content-files'), uploadData);
+
+                               expect(ev.result).not.toEqual(false);
+                       });
                        it('drop on an element inside the table does not trigger upload if no upload permission', function() {
                                $('#permissions').val(0);
                                var ev;