Skip to content

Commit

Permalink
Merge pull request #9238 from nextcloud/13-8945
Browse files Browse the repository at this point in the history
[stable13] Fixed files copy/move when in favorites or recent section
  • Loading branch information
MorrisJobke authored Apr 18, 2018
2 parents 5262685 + 5253343 commit 51ae913
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 @@ -633,10 +633,10 @@
actionHandler: function (filename, context) {
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, OC.dialogs.FILEPICKER_TYPE_COPY_MOVE);
}
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 @@ -2035,10 +2035,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 @@ -2098,13 +2100,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 51ae913

Please sign in to comment.