]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add file action to move files and folders
authorRobin Appelman <robin@icewind.nl>
Fri, 14 Oct 2016 14:23:11 +0000 (16:23 +0200)
committerRobin Appelman <robin@icewind.nl>
Fri, 14 Oct 2016 14:23:11 +0000 (16:23 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files/js/fileactions.js

index 015635c2e1d84c113ebbfff3eba8ac618e7d9382..8d2178578e58f0a34adb4c78f16f98055c7b6982 100644 (file)
                                }
                        });
 
+                       this.registerAction({
+                               name: 'Move',
+                               displayName: t('files', 'Move'),
+                               mime: 'all',
+                               order: -25,
+                               permissions: OC.PERMISSION_UPDATE,
+                               iconClass: 'icon-rename',
+                               actionHandler: function (filename, context) {
+                                       OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath) {
+                                               context.fileList.move(filename, targetPath);
+                                       }, false, "httpd/unix-directory", true);
+                               }
+                       });
+
                        this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
                                var dir = context.$file.attr('data-path') || context.fileList.getCurrentDirectory();
                                context.fileList.changeDirectory(OC.joinPaths(dir, filename), true, false, parseInt(context.$file.attr('data-id'), 10));