-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add openWith
function to OCA.Viewer
#1273
Conversation
So, you would just register a new action called I assume this is an issue about default registration priority? |
@skjnldsv It didnt make much sense to pass the full handler to the openWith function so I changed it so we only need to pass the handler ID: OCA.Viewer.openWith(
'richdocuments',
{ path: context.fileInfoModel.getFullPath() }
) Also previously I immediately cleared the override handler after opening the file. But it makes more sense to clear it (as you suggested) when the viewer is closed, in the case that a file-list is passed to the viewer. |
/compile amend / |
5fe40c6
to
31e30f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works and code looks sane 👍
@skjnldsv Mind to have another quick look as well? |
/compile amend / |
1ac581f
to
9c4f9df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the liberty to add 1ac581f
to avoid confusion between the selected handler and the one in the find lambda function.
Works fine with nextcloud/richdocuments#2298 👍
Code looks good.
Signed-off-by: Raul <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
9c4f9df
to
c2397cd
Compare
/backport to 24 |
The backport to 24 failed. Please do this backport manually. |
Add `openWith` function to OCA.Viewer
Add `openWith` function to OCA.Viewer Signed-off-by: Raul <[email protected]>
Add `openWith` function to OCA.Viewer Signed-off-by: Raul <[email protected]>
Adds the function
OCA.Viewer.openWith(handler, filePath, options)
The function can be used for opening files with the specified handler. This functionality would be needed for cases where a handler may not be suitable as the default option for a mime-type (e.g. collabora and PDFs nextcloud/richdocuments#1894)