Repository navigation
Improve FileActions JS to allow for custom rendering - #12394
Conversation
This improves the OCA.Files.FileActions class to support passing a "render" function in the action object. The default function "_defaultRenderFunction" is used by default and renders actions in the usual actions container. Moved "Rename" and "Delete" to custom render functions.
|
The inspection completed: 1 new issues |
|
🚀 Test PASSed. 🚀 |
There was a problem hiding this comment.
What about the action.render === false for disabled idea?
There was a problem hiding this comment.
The idea was conditionally disabled actions.
In such case the implementer of the "render()" function must make it return false/null and not render anything to disable the action based on the context condition.
There was a problem hiding this comment.
|
Set milestone to OC 8 as it's a requirement to be able to implement files favorites. |
|
Code looks good, things still seem to work 👍 |
|
@nickvergessen can you have another look ? |
|
👍 |
Improve FileActions JS to allow for custom rendering
|
That was quick :D |
This improves the OCA.Files.FileActions class to support passing a
"render" function in the action object.
The default function "_defaultRenderFunction" is used by default and
renders actions in the usual actions container.
Moved "Rename" and "Delete" to custom render functions.
Note: this change will be needed when adding the "Favorite" action (mostly to avoid additional ugly hard-codings...)
Please review @MorrisJobke @icewind1991 @schiesbn @th3fallen