summaryrefslogtreecommitdiffstats
path: root/apps/files/js/fileactions.js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-09-27 01:50:24 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-10-19 01:46:13 +0200
commita8f1902b02d02cc2b7d624b3d7b288f8aea84fdc (patch)
tree5f5ff64d4b9e989c4573f0e4049c19782282d150 /apps/files/js/fileactions.js
parentbea04d12d5a9ae8653277fc6379468d990f397ea (diff)
downloadnextcloud-server-a8f1902b02d02cc2b7d624b3d7b288f8aea84fdc.tar.gz
nextcloud-server-a8f1902b02d02cc2b7d624b3d7b288f8aea84fdc.zip
Add support to FileActionsMenu for icon class functions
Icon class function properties make possible to render a different icon class depending on the context of the file action. Inline file actions had support for them already and called them passing the file name and context of the file action as parameters. Due to this the FileActionsMenu passes those parameters too to icon class functions instead of just the context like done for display name functions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files/js/fileactions.js')
-rw-r--r--apps/files/js/fileactions.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 3da9b06b0d3..0f320c8b3c7 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -706,7 +706,7 @@
* @property {String} mime mime type
* @property {int} permissions permissions
* @property {(Function|String)} icon icon path to the icon or function that returns it (deprecated, use iconClass instead)
- * @property {(Function|String)} iconClass class name of the icon (recommended for theming)
+ * @property {(String|OCA.Files.FileActions~iconClassFunction)} iconClass class name of the icon (recommended for theming)
* @property {OCA.Files.FileActions~renderActionFunction} [render] optional rendering function
* @property {OCA.Files.FileActions~actionHandler} actionHandler action handler function
*/
@@ -746,6 +746,17 @@
*/
/**
+ * Icon class function for actions.
+ * The function returns the icon class of the action using
+ * the given context information.
+ *
+ * @callback OCA.Files.FileActions~iconClassFunction
+ * @param {String} fileName name of the file on which the action must be performed
+ * @param {OCA.Files.FileActionContext} context action context
+ * @return {String} icon class
+ */
+
+ /**
* Action handler function for file actions
*
* @callback OCA.Files.FileActions~actionHandler