diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-12-11 15:14:30 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-12-11 15:14:30 +0100 |
commit | baa5a69c55848aede39e14c936f837f77a221496 (patch) | |
tree | 77933a5c6063dbe87e687cc81f97d931c6d9707f /apps/files/js/fileactionsmenu.js | |
parent | 4f860b7e0a5284eee90fdd93d6ec733a1559a1eb (diff) | |
download | nextcloud-server-baa5a69c55848aede39e14c936f837f77a221496.tar.gz nextcloud-server-baa5a69c55848aede39e14c936f837f77a221496.zip |
Bring back file delete action text to be based on context
For received shares, the delete action becomes "Unshare" and for
personal mounts it becomes "Disconnect storage".
This also makes it possible from now on to pass a function to a file
action's "displayName" attribute.
Diffstat (limited to 'apps/files/js/fileactionsmenu.js')
-rw-r--r-- | apps/files/js/fileactionsmenu.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files/js/fileactionsmenu.js b/apps/files/js/fileactionsmenu.js index 67cbb48c965..9e51d8f1f1f 100644 --- a/apps/files/js/fileactionsmenu.js +++ b/apps/files/js/fileactionsmenu.js @@ -81,6 +81,7 @@ * Renders the menu with the currently set items */ render: function() { + var self = this; var fileActions = this._context.fileActions; var actions = fileActions.getActions( fileActions.getCurrentMimeType(), @@ -100,6 +101,13 @@ (!defaultAction || actionSpec.name !== defaultAction.name) ); }); + items = _.map(items, function(item) { + if (_.isFunction(item.displayName)) { + item = _.extend({}, item); + item.displayName = item.displayName(self._context); + } + return item; + }); items = items.sort(function(actionA, actionB) { var orderA = actionA.order || 0; var orderB = actionB.order || 0; |