aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/fileactions.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-21 12:54:34 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 10:06:29 +0200
commit1d9129eac35b49a4e8d0d642a68d7d634f31c905 (patch)
tree513bdd46bb2e557bbac678aff73d1766b8e3c9c6 /apps/files/js/fileactions.js
parent6fbf4d8548133dff4419e5e2e0c649f49e177669 (diff)
downloadnextcloud-server-1d9129eac35b49a4e8d0d642a68d7d634f31c905.tar.gz
nextcloud-server-1d9129eac35b49a4e8d0d642a68d7d634f31c905.zip
Sharing overview fixes and unit tests
- Fixed renaming and fileActionsReady event - Added unit tests for shares list - Fixed public page with defer - Fixed file actions in sharing overview - Fixed sharing counterpart list (10 entries max) - Fixed file path attribute to be used in download action - Fix sharing list headers - OC.Share icons now operate on fileList instance - Fix OC.Share.updateIcon when more than one list in DOM
Diffstat (limited to 'apps/files/js/fileactions.js')
-rw-r--r--apps/files/js/fileactions.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 8cee037e294..3df62f37518 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -232,7 +232,7 @@
}
if (triggerEvent){
- fileList.$fileList.trigger(jQuery.Event("fileActionsReady"));
+ fileList.$fileList.trigger(jQuery.Event("fileActionsReady", {fileList: fileList}));
}
},
getCurrentFile: function () {
@@ -252,8 +252,6 @@
* Register the actions that are used by default for the files app.
*/
registerDefaultActions: function() {
- // TODO: try to find a way to not make it depend on fileList,
- // maybe get a handler or listener to trigger events on
this.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename, context) {
@@ -287,7 +285,8 @@
this.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
}, function (filename, context) {
- var url = context.fileList.getDownloadUrl(filename, context.fileList.getCurrentDirectory());
+ var dir = context.dir || context.fileList.getCurrentDirectory();
+ var url = context.fileList.getDownloadUrl(filename, dir);
if (url) {
OC.redirect(url);
}
@@ -309,11 +308,13 @@
// through window.FileActions will be limited to the main file list.
window.FileActions = OCA.Files.legacyFileActions;
window.FileActions.register = function (mime, name, permissions, icon, action, displayName) {
- console.warn('FileActions.register() is deprecated, please use OCA.Files.fileActions.register() instead');
- OCA.Files.FileActions.prototype.register.call(window.FileActions, mime, name, permissions, icon, action, displayName);
+ console.warn('FileActions.register() is deprecated, please use OCA.Files.fileActions.register() instead', arguments);
+ OCA.Files.FileActions.prototype.register.call(
+ window.FileActions, mime, name, permissions, icon, action, displayName
+ );
};
window.FileActions.setDefault = function (mime, name) {
- console.warn('FileActions.setDefault() is deprecated, please use OCA.Files.fileActions.setDefault() instead');
+ console.warn('FileActions.setDefault() is deprecated, please use OCA.Files.fileActions.setDefault() instead', mime, name);
OCA.Files.FileActions.prototype.setDefault.call(window.FileActions, mime, name);
};
})();