summaryrefslogtreecommitdiffstats
path: root/apps/files/js/fileactions.js
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-08-27 17:39:22 +0200
committerThomas Citharel <tcit@tcit.fr>2017-09-15 16:53:10 +0200
commit33f0601862c337799235c06282764fc95fe21f02 (patch)
tree9d3a343f2e8294c5cd415e87cddf355eb395f863 /apps/files/js/fileactions.js
parent246a5a5750dd2b8f990797b2c6cc4270a9a5b59d (diff)
downloadnextcloud-server-33f0601862c337799235c06282764fc95fe21f02.tar.gz
nextcloud-server-33f0601862c337799235c06282764fc95fe21f02.zip
[WIP] Added copy and move buttons
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'apps/files/js/fileactions.js')
-rw-r--r--apps/files/js/fileactions.js29
1 files changed, 10 insertions, 19 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 527cbc0bd34..668960d5937 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -618,30 +618,21 @@
});
this.registerAction({
- name: 'Move',
- displayName: t('files', 'Move'),
+ name: 'CopyMove',
+ displayName: t('files', 'Copy or Move'),
mime: 'all',
order: -25,
permissions: OC.PERMISSION_UPDATE,
iconClass: 'icon-external',
actionHandler: function (filename, context) {
- OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath) {
- context.fileList.move(filename, targetPath);
- }, false, "httpd/unix-directory", true);
- }
- });
-
- this.registerAction({
- name: 'Copy',
- displayName: t('files', 'Copy'),
- mime: 'all',
- order: -25,
- permissions: OC.PERMISSION_READ,
- iconClass: 'icon-external',
- actionHandler: function (filename, context) {
- OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath) {
- context.fileList.copy(filename, targetPath);
- }, false, "httpd/unix-directory", true);
+ OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath, type) {
+ if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
+ context.fileList.copy(filename, targetPath);
+ }
+ if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
+ context.fileList.move(filename, targetPath);
+ }
+ }, false, "httpd/unix-directory", true, OC.dialogs.FILEPICKER_TYPE_COPY_MOVE);
}
});