Skip to content

Commit

Permalink
Merge pull request #8945 from nextcloud/fix-files-copy-in-recent-favo…
Browse files Browse the repository at this point in the history
…rites

Fixed files copy/move when in favorites or recent section
  • Loading branch information
MorrisJobke committed Apr 3, 2018
2 parents 6dca0bb + 24ecf3f commit 56fa44b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apps/files/js/fileactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
11 changes: 7 additions & 4 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += '/';
}
Expand Down Expand Up @@ -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 += '/';
}
Expand Down

0 comments on commit 56fa44b

Please sign in to comment.