diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-05-20 16:01:34 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-05-30 10:06:29 +0200 |
commit | ef59c69dc822c9ff69c564c41e0dfdce142b9cdf (patch) | |
tree | a99667ab22daba65cbbd77ac591fccac234f06eb /apps/files/js/app.js | |
parent | fa32243d84e1801c379a5e8956ba2f3de236c718 (diff) | |
download | nextcloud-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/js/app.js')
-rw-r--r-- | apps/files/js/app.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js index 6d8a9788d97..6ccf5135000 100644 --- a/apps/files/js/app.js +++ b/apps/files/js/app.js @@ -24,20 +24,27 @@ initialize: function() { this.navigation = new OCA.Files.Navigation($('#app-navigation')); - // TODO: ideally these should be in a separate class / app (the embedded "all files" app) - this.fileActions = OCA.Files.FileActions.clone(); + var fileActions = new OCA.Files.FileActions(); + // default actions + fileActions.registerDefaultActions(); + // legacy actions + fileActions.merge(window.FileActions); + // regular actions + fileActions.merge(OCA.Files.fileActions); + this.files = OCA.Files.Files; + // TODO: ideally these should be in a separate class / app (the embedded "all files" app) this.fileList = new OCA.Files.FileList( $('#app-content-files'), { scrollContainer: $('#app-content'), dragOptions: dragOptions, - folderDropOptions: folderDropOptions + folderDropOptions: folderDropOptions, + fileActions: fileActions, + allowLegacyActions: true } ); this.files.initialize(); - this.fileActions.registerDefaultActions(); - this.fileList.setFileActions(this.fileActions); // for backward compatibility, the global FileList will // refer to the one of the "files" view @@ -146,7 +153,7 @@ })(); $(document).ready(function() { - // wait for other apps/extensions to register their event handlers + // wait for other apps/extensions to register their event handlers and file actions // in the "ready" clause _.defer(function() { OCA.Files.App.initialize(); |