Skip to content

Commit

Permalink
Merge pull request #836 from owncloud/update-file-actions
Browse files Browse the repository at this point in the history
Fileactions: get rid of deprecate register function, adjust name, displayName and icon
  • Loading branch information
Jan Ackermann committed Apr 13, 2021
2 parents 35b4cdb + 9d35fa5 commit 13143aa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions js/galleryfileaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@
for (i = 0; i < mediaTypesLength; i++) {
// Each click handler gets the same function and images array and
// is responsible to load the slideshow
OCA.Files.fileActions.register(mediaTypes[i], 'View', OC.PERMISSION_READ, '',
galleryFileAction.onView);
OCA.Files.fileActions.setDefault(mediaTypes[i], 'View');
OCA.Files.fileActions.registerAction({
mime: mediaTypes[i],
name: 'Gallery',
permissions: OC.PERMISSION_READ,
icon: OC.imagePath('gallery', 'gallery-dark'),
actionHandler: galleryFileAction.onView,
displayName: t('gallery', 'Open in Gallery')
})
;
OCA.Files.fileActions.setDefault(mediaTypes[i], 'Gallery');
}
},

Expand Down

0 comments on commit 13143aa

Please sign in to comment.