Fixed files copy/move when in favorites or recent section

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-03-22 15:31:18 +01:00 committed by Morris Jobke
parent fa65aaf1fc
commit 5253343885
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 9 additions and 6 deletions

View File

@ -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);
}

View File

@ -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 += '/';
}
@ -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 += '/';
}