Skip to content

Commit

Permalink
fix(files): Ignore right click for default action
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Jun 13, 2024
1 parent f606208 commit 83072f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 1494 files
8 changes: 8 additions & 0 deletions apps/files/src/components/FileEntryMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ export default defineComponent({
/**
* When the source changes, reset the preview
* and fetch the new one.
*
* @param a
* @param b
*/
source(a: Node, b: Node) {
if (a.source !== b.source) {
Expand Down Expand Up @@ -225,6 +228,11 @@ export default defineComponent({
},

execDefaultAction(event) {
// Ignore right click.
if (event.button === 2) {
return
}

// if ctrl+click or middle mouse button, open in new tab
if (event.ctrlKey || event.metaKey || event.button === 1) {
event.preventDefault()
Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit 83072f0

Please sign in to comment.