diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-12-22 14:05:22 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-12-27 10:15:42 +0100 |
commit | 2c7f63276e7ad8c0a82e37fa3bf3b02aa30a2b68 (patch) | |
tree | 6d65b173ceaecd8ad50f0513e9967218907b00f7 /apps/files | |
parent | fc7e643eb4de6be01adf8243e21d065e002ae94b (diff) | |
download | nextcloud-server-2c7f63276e7ad8c0a82e37fa3bf3b02aa30a2b68.tar.gz nextcloud-server-2c7f63276e7ad8c0a82e37fa3bf3b02aa30a2b68.zip |
fix(files): Allow Ctrl/Command click on file entries to open in a new tab
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 11 | ||||
-rw-r--r-- | apps/files/src/components/FileEntryGrid.vue | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index b89c5dcb3f4..3ed8b0a5d4b 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -105,6 +105,7 @@ import { showError } from '@nextcloud/dialogs' import { translate as t } from '@nextcloud/l10n' import { vOnClickOutside } from '@vueuse/components' import moment from '@nextcloud/moment' +import { generateUrl } from '@nextcloud/router' import Vue, { defineComponent } from 'vue' import { action as sidebarAction } from '../actions/sidebarAction.ts' @@ -398,8 +399,14 @@ export default defineComponent({ event.stopPropagation() }, - execDefaultAction(...args) { - this.$refs.actions.execDefaultAction(...args) + execDefaultAction(event) { + event.preventDefault() + if (event.ctrlKey || event.metaKey) { + window.open(generateUrl('/f/{fileId}', { fileId: this.fileid })) + return false + } + + this.$refs.actions.execDefaultAction(event) }, openDetailsIfAvailable(event) { diff --git a/apps/files/src/components/FileEntryGrid.vue b/apps/files/src/components/FileEntryGrid.vue index def818eea2f..682c5fbbc23 100644 --- a/apps/files/src/components/FileEntryGrid.vue +++ b/apps/files/src/components/FileEntryGrid.vue @@ -80,6 +80,7 @@ import { FileType, Permission, Folder, File as NcFile, NodeStatus, Node, View } import { getUploader } from '@nextcloud/upload' import { showError } from '@nextcloud/dialogs' import { translate as t } from '@nextcloud/l10n' +import { generateUrl } from '@nextcloud/router' import { vOnClickOutside } from '@vueuse/components' import Vue from 'vue' @@ -281,8 +282,14 @@ export default Vue.extend({ event.stopPropagation() }, - execDefaultAction(...args) { - this.$refs.actions.execDefaultAction(...args) + execDefaultAction(event) { + event.preventDefault() + if (event.ctrlKey || event.metaKey) { + window.open(generateUrl('/f/{fileId}', { fileId: this.fileid })) + return false + } + + this.$refs.actions.execDefaultAction(event) }, openDetailsIfAvailable(event) { |