[Pkg-owncloud-commits] [owncloud] 22/199: Fix dropping files below the table
David Prévot
taffit at moszumanska.debian.org
Sun Jun 1 18:53:05 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit d6e1643a0e448c45f35311c3635125a2c0f39a45
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Thu May 22 11:16:42 2014 +0200
Fix dropping files below the table
---
apps/files/css/files.css | 5 +++++
apps/files/js/filelist.js | 5 ++---
apps/files/templates/index.php | 2 +-
apps/files/tests/js/filelistSpec.js | 8 +++++++-
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index 009cb35..e397d27 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -91,6 +91,11 @@
position: relative;
}
+/* fit app list view heights */
+.app-files #app-content>.viewcontainer {
+ height: 100%;
+}
+
/**
* Override global #controls styles
* to be more flexible / relative
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 3d107c7..9f6840e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1517,10 +1517,9 @@
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;
}
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 8cab4ce..b52effb 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -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 } ?>
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index e5bbf0f..61a0dc3 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list