Skip to content

Commit

Permalink
Separate actions for contextmenu and image click fixes #121 (#122) (#123
Browse files Browse the repository at this point in the history
)

Signed-off-by: Robin Windey <[email protected]>
  • Loading branch information
R0Wi authored Jun 9, 2023
1 parent 186dee2 commit 488ea54
Showing 1 changed file with 18 additions and 2 deletions.
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

0 comments on commit 488ea54

Please sign in to comment.