|
363 | 363 |
|
364 | 364 | /** |
365 | 365 | * Renders the menu trigger on the given file list row |
366 | | - * |
| 366 | + * |
367 | 367 | * @param {Object} $tr file list row element |
368 | 368 | * @param {OCA.Files.FileActionContext} context rendering context |
369 | 369 | */ |
|
617 | 617 | } |
618 | 618 | }); |
619 | 619 |
|
| 620 | + this.registerAction({ |
| 621 | + name: 'Move', |
| 622 | + displayName: t('files', 'Move'), |
| 623 | + mime: 'all', |
| 624 | + order: -25, |
| 625 | + permissions: OC.PERMISSION_UPDATE, |
| 626 | + iconClass: 'icon-external', |
| 627 | + actionHandler: function (filename, context) { |
| 628 | + OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath) { |
| 629 | + context.fileList.move(filename, targetPath); |
| 630 | + }, false, "httpd/unix-directory", true); |
| 631 | + } |
| 632 | + }); |
| 633 | + |
620 | 634 | this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { |
621 | 635 | var dir = context.$file.attr('data-path') || context.fileList.getCurrentDirectory(); |
622 | 636 | context.fileList.changeDirectory(OC.joinPaths(dir, filename), true, false, parseInt(context.$file.attr('data-id'), 10)); |
|
744 | 758 | OCA.Files.legacyFileActions = new OCA.Files.FileActions(); |
745 | 759 |
|
746 | 760 | // for backward compatibility |
747 | | - // |
| 761 | + // |
748 | 762 | // legacy apps are expecting a stateful global FileActions object to register |
749 | 763 | // their actions on. Since legacy apps are very likely to break with other |
750 | 764 | // FileList views than the main one ("All files"), actions registered |
|
763 | 777 | OCA.Files.FileActions.prototype.display.call(window.FileActions, parent, triggerEvent, fileList); |
764 | 778 | }; |
765 | 779 | })(); |
766 | | - |
|
0 commit comments