Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-20 18:01:34 +0400
committerVincent Petry <pvince81@owncloud.com>2014-05-30 12:06:29 +0400
commitef59c69dc822c9ff69c564c41e0dfdce142b9cdf (patch)
treea99667ab22daba65cbbd77ac591fccac234f06eb /apps/files/js/app.js
parentfa32243d84e1801c379a5e8956ba2f3de236c718 (diff)
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.js19
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();