summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-01-18 17:20:54 +0100
committerGitHub <noreply@github.com>2019-01-18 17:20:54 +0100
commit743323ee48552b52b79bbc105f166cb88eba2342 (patch)
tree06096a5c080016c7895ef349a72a89a66c72ce90 /apps
parent10ab678aa5f82885cef54140d9b1bed8c990ca2e (diff)
parent332b4aee9da4ffe6f7f79255ca4ce75b8a283693 (diff)
downloadnextcloud-server-743323ee48552b52b79bbc105f166cb88eba2342.tar.gz
nextcloud-server-743323ee48552b52b79bbc105f166cb88eba2342.zip
Merge pull request #12381 from rummatee/master
Move/copy file picker: Remeber last destination and start in current folder
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/fileactions.js7
-rw-r--r--apps/files/js/filelist.js7
2 files changed, 12 insertions, 2 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 2981fb64c11..ef29551c591 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -648,6 +648,10 @@
if (permissions & OC.PERMISSION_UPDATE) {
actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE;
}
+ var dialogDir = context.dir;
+ if (typeof context.fileList.dirInfo.dirLastCopiedTo !== 'undefined') {
+ dialogDir = context.fileList.dirInfo.dirLastCopiedTo;
+ }
OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {
if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
context.fileList.copy(filename, targetPath, false, context.dir);
@@ -655,7 +659,8 @@
if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
context.fileList.move(filename, targetPath, false, context.dir);
}
- }, false, "httpd/unix-directory", true, actions);
+ context.fileList.dirInfo.dirLastCopiedTo = targetPath;
+ }, false, "httpd/unix-directory", true, actions, dialogDir);
}
});
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index bcecdb697fe..29c5a49131d 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -918,6 +918,10 @@
};
var actions = this.isSelectedMovable() ? OC.dialogs.FILEPICKER_TYPE_COPY_MOVE : OC.dialogs.FILEPICKER_TYPE_COPY;
+ var dialogDir = self.getCurrentDirectory();
+ if (typeof self.dirInfo.dirLastCopiedTo !== 'undefined') {
+ dialogDir = self.dirInfo.dirLastCopiedTo;
+ }
OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {
self.fileMultiSelectMenu.toggleLoading('copyMove', true);
if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
@@ -926,7 +930,8 @@
if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
self.move(files, targetPath, disableLoadingState);
}
- }, false, "httpd/unix-directory", true, actions);
+ self.dirInfo.dirLastCopiedTo = targetPath;
+ }, false, "httpd/unix-directory", true, actions, dialogDir);
event.preventDefault();
},