Fixed files copy/move when in favorites or recent section
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
8c6b6b1f0d
commit
24ecf3f4c9
|
@ -644,10 +644,10 @@
|
||||||
}
|
}
|
||||||
OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath, type) {
|
OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath, type) {
|
||||||
if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
|
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) {
|
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);
|
}, false, "httpd/unix-directory", true, actions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2047,10 +2047,12 @@
|
||||||
* @param fileNames array of file names to move
|
* @param fileNames array of file names to move
|
||||||
* @param targetPath absolute target path
|
* @param targetPath absolute target path
|
||||||
* @param callback function to call when movement is finished
|
* @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 self = this;
|
||||||
var dir = this.getCurrentDirectory();
|
|
||||||
|
dir = typeof dir === 'string' ? dir : this.getCurrentDirectory();
|
||||||
if (dir.charAt(dir.length - 1) !== '/') {
|
if (dir.charAt(dir.length - 1) !== '/') {
|
||||||
dir += '/';
|
dir += '/';
|
||||||
}
|
}
|
||||||
|
@ -2110,13 +2112,14 @@
|
||||||
* @param fileNames array of file names to copy
|
* @param fileNames array of file names to copy
|
||||||
* @param targetPath absolute target path
|
* @param targetPath absolute target path
|
||||||
* @param callback to call when copy is finished with success
|
* @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 self = this;
|
||||||
var filesToNotify = [];
|
var filesToNotify = [];
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
var dir = this.getCurrentDirectory();
|
dir = typeof dir === 'string' ? dir : this.getCurrentDirectory();
|
||||||
if (dir.charAt(dir.length - 1) !== '/') {
|
if (dir.charAt(dir.length - 1) !== '/') {
|
||||||
dir += '/';
|
dir += '/';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue