summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/app.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-19 15:20:44 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 10:06:29 +0200
commit60bcdc550e95fbf0104bbc9c8028777016d73663 (patch)
treed6ca8475d7ea4cb8aa7e034add8902926171e612 /apps/files_sharing/js/app.js
parent279ede33af09c43e03f97458c7fa673ff2b7982a (diff)
downloadnextcloud-server-60bcdc550e95fbf0104bbc9c8028777016d73663.tar.gz
nextcloud-server-60bcdc550e95fbf0104bbc9c8028777016d73663.zip
Fixed file actions for sharing views
FileActions can now be clone to be use for separate file list views without having the side-effect of affecting the main file list view. Added "Open" action in sharing overview file lists to redirect to the regular file list when clicking on a folder.
Diffstat (limited to 'apps/files_sharing/js/app.js')
-rw-r--r--apps/files_sharing/js/app.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js
index 887575193d0..9808e069784 100644
--- a/apps/files_sharing/js/app.js
+++ b/apps/files_sharing/js/app.js
@@ -27,9 +27,7 @@ OCA.Sharing.App = {
}
);
- var fileActions = _.extend({}, OCA.Files.FileActions);
- fileActions.registerDefaultActions(this._inFileList);
- this._inFileList.setFileActions(fileActions);
+ this._initFileActions(this._inFileList);
},
initSharingOut: function($el) {
@@ -44,9 +42,18 @@ OCA.Sharing.App = {
}
);
- var fileActions = _.extend({}, OCA.Files.FileActions);
- fileActions.registerDefaultActions(this._outFileList);
- this._outFileList.setFileActions(fileActions);
+ this._initFileActions(this._outFileList);
+ },
+
+ _initFileActions: function(fileList) {
+ var fileActions = OCA.Files.FileActions.clone();
+ // when the user clicks on a folder, redirect to the corresponding
+ // folder in the files app
+ fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
+ OCA.Files.App.setActiveView('files', {silent: true});
+ OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true);
+ });
+ fileList.setFileActions(fileActions);
}
};