summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-15 15:54:16 +0200
committerVincent Petry <pvince81@owncloud.com>2013-10-15 15:59:45 +0200
commit92e646413a8b2df3c16306b75deab506b6eb4ec2 (patch)
treec954b04e97e17d968bce6255796c3ac60a4b573c /apps/files
parent8c25b5a0c168553d22de40dcbf7d1db557cf1a00 (diff)
downloadnextcloud-server-92e646413a8b2df3c16306b75deab506b6eb4ec2.tar.gz
nextcloud-server-92e646413a8b2df3c16306b75deab506b6eb4ec2.zip
Fixed drag and drop onto folders
Fixes #5351
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/filelist.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index a9297996778..02de2f2415e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -698,11 +698,23 @@ $(document).ready(function(){
// array index 0 contains the max files size
// array index 1 contains the request token
// array index 2 contains the directory
- var parentDir = formArray[2]['value'];
- if (parentDir === '/') {
- formArray[2]['value'] += dir;
- } else {
- formArray[2]['value'] += '/' + dir;
+ if (formArray.length){
+ var parentDir = formArray[2]['value'];
+ if (parentDir === '/') {
+ formArray[2]['value'] += dir;
+ } else {
+ formArray[2]['value'] += '/' + dir;
+ }
+ }
+ else{
+ var parentDir = $('#dir').val() || '';
+ if (parentDir[parentDir.length - 1] != '/'){
+ parentDir += '/';
+ }
+ return [
+ {name: 'dir', value: parentDir + dir},
+ {name: 'requesttoken', value: oc_requesttoken}
+ ];
}
return formArray;