Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable13] Fixed files copy/move when in favorites or recent section #9238

Merged
merged 1 commit into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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