summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-22 15:31:18 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-04-18 17:54:04 +0200
commit5253343885e9c2d2d6afbdff4d8db8c49ec318f3 (patch)
tree4cb6c4be2e46408dea3a984e806b8d0b23f7088d /apps/files
parentfa65aaf1fc8836e1a0e5ee1ffe38ee032a487892 (diff)
downloadnextcloud-server-5253343885e9c2d2d6afbdff4d8db8c49ec318f3.tar.gz
nextcloud-server-5253343885e9c2d2d6afbdff4d8db8c49ec318f3.zip
Fixed files copy/move when in favorites or recent section
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/fileactions.js4
-rw-r--r--apps/files/js/filelist.js11
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 2fb7dfba29f..9f3883bc8db 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -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);
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index e50b402dea8..1b924e0e22f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -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 += '/';
}