From ef59c69dc822c9ff69c564c41e0dfdce142b9cdf Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 20 May 2014 16:01:34 +0200 Subject: 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. --- apps/files_sharing/js/share.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'apps/files_sharing/js/share.js') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 28586a179a4..1fcb1f088bf 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -9,10 +9,7 @@ */ $(document).ready(function() { - - var sharesLoaded = false; - - if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') { + if (!_.isUndefined(OC.Share) && !_.isUndefined(OCA.Files)) { // TODO: make a separate class for this or a hook or jQuery event ? if (OCA.Files.FileList) { var oldCreateRow = OCA.Files.FileList.prototype._createRow; @@ -64,18 +61,18 @@ $(document).ready(function() { } }) - if (!sharesLoaded){ + if (!OCA.Sharing.sharesLoaded){ OC.Share.loadIcons('file', $fileList); // assume that we got all shares, so switching directories // will not invalidate that list - sharesLoaded = true; + OCA.Sharing.sharesLoaded = true; } else{ OC.Share.updateIcons('file', $fileList); } }); - OCA.Files.FileActions.register( + OCA.Files.fileActions.register( 'all', 'Share', OC.PERMISSION_SHARE, -- cgit v1.2.3