summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-14 12:38:49 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-14 12:38:49 +0200
commitbc6f76250addc55ca1aa3a66e7956e5c7fd89d4a (patch)
treed1a117a065423817b3dcc3425f8facb5711fca4a /apps/files_trashbin
parent3e8756003371103d3d68824dcafaf83cfb81f689 (diff)
parent6b71efb2b1bc988e0cca5528b12d52e9c3116ec9 (diff)
downloadnextcloud-server-bc6f76250addc55ca1aa3a66e7956e5c7fd89d4a.tar.gz
nextcloud-server-bc6f76250addc55ca1aa3a66e7956e5c7fd89d4a.zip
Merge pull request #19701 from owncloud/trash-restoreactioninline
Make trashbin's "Restore" an inline action
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/js/app.js34
1 files changed, 21 insertions, 13 deletions
diff --git a/apps/files_trashbin/js/app.js b/apps/files_trashbin/js/app.js
index c3be762f095..807d5704be1 100644
--- a/apps/files_trashbin/js/app.js
+++ b/apps/files_trashbin/js/app.js
@@ -43,19 +43,27 @@ OCA.Trashbin.App = {
fileActions.setDefault('dir', 'Open');
- fileActions.register('all', 'Restore', OC.PERMISSION_READ, OC.imagePath('core', 'actions/history'), function(filename, context) {
- var fileList = context.fileList;
- var tr = fileList.findFileEl(filename);
- var deleteAction = tr.children("td.date").children(".action.delete");
- deleteAction.removeClass('icon-delete').addClass('icon-loading-small');
- fileList.disableActions();
- $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), {
- files: JSON.stringify([filename]),
- dir: fileList.getCurrentDirectory()
- },
- _.bind(fileList._removeCallback, fileList)
- );
- }, t('files_trashbin', 'Restore'));
+ fileActions.registerAction({
+ name: 'Restore',
+ displayName: t('files_trashbin', 'Restore'),
+ type: OCA.Files.FileActions.TYPE_INLINE,
+ mime: 'all',
+ permissions: OC.PERMISSION_READ,
+ icon: OC.imagePath('core', 'actions/history'),
+ actionHandler: function(filename, context) {
+ var fileList = context.fileList;
+ var tr = fileList.findFileEl(filename);
+ var deleteAction = tr.children("td.date").children(".action.delete");
+ deleteAction.removeClass('icon-delete').addClass('icon-loading-small');
+ fileList.disableActions();
+ $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), {
+ files: JSON.stringify([filename]),
+ dir: fileList.getCurrentDirectory()
+ },
+ _.bind(fileList._removeCallback, fileList)
+ );
+ }
+ });
fileActions.registerAction({
name: 'Delete',