Skip to content
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

Separate actions for contextmenu and image click fixes #121 #122

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions js/fileAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@
* Default action
*/
_getAction: function () {
return {
actionHandler: this._actionHandler.bind(this),
displayName: "PhotoSphereViewer",
icon: "",
mime: "image/jpeg",
name: "view",
permissions: 1,
order: -1
};
},

/*
* Action for "Open in PhotoSphereViewer"
*/
_getContextMenuAction: function() {
return {
name: "viewInPhotosphereViewer",
displayName: "View in PhotoSphereViewer",
Expand Down Expand Up @@ -341,8 +356,9 @@
this._oldActionHandler = currActions.view.action;
}

OCA.Files.fileActions.registerAction(this._getAction());
OCA.Files.fileActions.registerAction(this._getVideoAction());
OCA.Files.fileActions.registerAction(this._getAction()); // Check for PhotoSphere on image click
OCA.Files.fileActions.registerAction(this._getContextMenuAction()); // Force open in PhotoSphereViewer via contextmenu
OCA.Files.fileActions.registerAction(this._getVideoAction()); // Open 360 video via contextmenu

OCA.Files.fileActions.setDefault(this._photoShpereMimeType, 'view');

Expand Down