Skip to content

Commit

Permalink
Merge pull request #42457 from nextcloud/bugfix/noid/ctrl-click
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Dec 27, 2023
2 parents fc7e643 + 8bbe06a commit 1fbfc4f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
11 changes: 9 additions & 2 deletions apps/files/src/components/FileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 9 additions & 2 deletions apps/files/src/components/FileEntryGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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) {
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 1fbfc4f

Please sign in to comment.