diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-03 10:30:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 10:30:08 +0200 |
commit | 56fa44b71def4fb9a8f45c14101aaf9641325a48 (patch) | |
tree | 4c162c3b7f1afa3389228b5bc3bc8f461782fd1d /apps | |
parent | 6dca0bbd79392a1d3d8fc26f2ea424aa76a5783f (diff) | |
parent | 24ecf3f4c91b93306dceb43577989ee137846844 (diff) | |
download | nextcloud-server-56fa44b71def4fb9a8f45c14101aaf9641325a48.tar.gz nextcloud-server-56fa44b71def4fb9a8f45c14101aaf9641325a48.zip |
Merge pull request #8945 from nextcloud/fix-files-copy-in-recent-favorites
Fixed files copy/move when in favorites or recent section
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/fileactions.js | 4 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index a6d376aa2a9..4c0ccaf6451 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -644,10 +644,10 @@ } OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath, type) { if (type === OC.dialogs.FILEPICKER_TYPE_COPY) { - context.fileList.copy(filename, targetPath); + context.fileList.copy(filename, targetPath, false, context.dir); } if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) { - context.fileList.move(filename, targetPath); + context.fileList.move(filename, targetPath, false, context.dir); } }, false, "httpd/unix-directory", true, actions); } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index e1a0491cdc8..9459b83dca2 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2047,10 +2047,12 @@ * @param fileNames array of file names to move * @param targetPath absolute target path * @param callback function to call when movement is finished + * @param dir the dir path where fileNames are located (optionnal, will take current folder if undefined) */ - move: function(fileNames, targetPath, callback) { + move: function(fileNames, targetPath, callback, dir) { var self = this; - var dir = this.getCurrentDirectory(); + + dir = typeof dir === 'string' ? dir : this.getCurrentDirectory(); if (dir.charAt(dir.length - 1) !== '/') { dir += '/'; } @@ -2110,13 +2112,14 @@ * @param fileNames array of file names to copy * @param targetPath absolute target path * @param callback to call when copy is finished with success + * @param dir the dir path where fileNames are located (optionnal, will take current folder if undefined) */ - copy: function(fileNames, targetPath, callback) { + copy: function(fileNames, targetPath, callback, dir) { var self = this; var filesToNotify = []; var count = 0; - var dir = this.getCurrentDirectory(); + dir = typeof dir === 'string' ? dir : this.getCurrentDirectory(); if (dir.charAt(dir.length - 1) !== '/') { dir += '/'; } |