aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-20 16:01:34 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 10:06:29 +0200
commitef59c69dc822c9ff69c564c41e0dfdce142b9cdf (patch)
treea99667ab22daba65cbbd77ac591fccac234f06eb /apps/files_sharing/js/public.js
parentfa32243d84e1801c379a5e8956ba2f3de236c718 (diff)
downloadnextcloud-server-ef59c69dc822c9ff69c564c41e0dfdce142b9cdf.tar.gz
nextcloud-server-ef59c69dc822c9ff69c564c41e0dfdce142b9cdf.zip
Distinguish legacy file actions from regular file actions
Legacy file actions are registered by legacy apps through window.FileActions.register(). These actions can only be used by the main file list ("all files") because legacy apps can only deal with a single list / container. New file actions of compatible apps must be registered through OCA.Files.fileActions. These will be used for other lists like the sharing overview. Fixed versions and sharing actions to use OCA.Files.fileActions, which makes them available in the sharing overview list.
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r--apps/files_sharing/js/public.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index d825ee9de15..446f3f2442b 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -19,9 +19,18 @@ OCA.Sharing.PublicApp = {
initialize: function($el) {
var self = this;
+ var fileActions;
if (this._initialized) {
return;
}
+ fileActions = new OCA.Files.FileActions();
+ // default actions
+ fileActions.registerDefaultActions();
+ // legacy actions
+ fileActions.merge(window.FileActions);
+ // regular actions
+ fileActions.merge(OCA.Files.fileActions);
+
this._initialized = true;
this.initialDir = $('#dir').val();
@@ -32,7 +41,8 @@ OCA.Sharing.PublicApp = {
{
scrollContainer: $(window),
dragOptions: dragOptions,
- folderDropOptions: folderDropOptions
+ folderDropOptions: folderDropOptions,
+ fileActions: fileActions
}
);
this.files = OCA.Files.Files;
@@ -121,10 +131,8 @@ OCA.Sharing.PublicApp = {
};
});
- this.fileActions = _.extend({}, OCA.Files.FileActions);
- this.fileActions.registerDefaultActions(this.fileList);
- delete this.fileActions.actions.all.Share;
- this.fileList.setFileActions(this.fileActions);
+ // do not allow sharing from the public page
+ delete this.fileList.fileActions.actions.all.Share;
this.fileList.changeDirectory(this.initialDir || '/', false, true);