aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-05-29 18:53:53 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2024-06-12 11:52:22 +0000
commita094ac0b6d61a8aefa92517549c615dfc43430a2 (patch)
tree103e4c84f7822de5f3ac3bdad254f191aef97a72 /apps
parent4c32ab7b729b7bb8e2a59eb4f8a0b3c657e0f2a1 (diff)
downloadnextcloud-server-a094ac0b6d61a8aefa92517549c615dfc43430a2.tar.gz
nextcloud-server-a094ac0b6d61a8aefa92517549c615dfc43430a2.zip
fix(files): also trigger new tab on file name middle click
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/components/FileEntry.vue4
-rw-r--r--apps/files/src/components/FileEntry/FileEntryName.vue3
-rw-r--r--apps/files/src/components/FileEntryGrid.vue4
-rw-r--r--apps/files/src/components/FileEntryMixin.ts3
4 files changed, 9 insertions, 5 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index cfce3e924e8..0ee04739282 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -30,6 +30,7 @@
<FileEntryPreview ref="preview"
:source="source"
:dragover="dragover"
+ @auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
<FileEntryName ref="name"
@@ -38,7 +39,8 @@
:files-list-width="filesListWidth"
:nodes="nodes"
:source="source"
- @click="execDefaultAction" />
+ @auxclick.native="execDefaultAction"
+ @click.native="execDefaultAction" />
</td>
<!-- Actions -->
diff --git a/apps/files/src/components/FileEntry/FileEntryName.vue b/apps/files/src/components/FileEntry/FileEntryName.vue
index 5e2e748e427..3e671c0c141 100644
--- a/apps/files/src/components/FileEntry/FileEntryName.vue
+++ b/apps/files/src/components/FileEntry/FileEntryName.vue
@@ -26,8 +26,7 @@
:aria-hidden="isRenaming"
class="files-list__row-name-link"
data-cy-files-list-row-name-link
- v-bind="linkTo.params"
- @click="$emit('click', $event)">
+ v-bind="linkTo.params">
<!-- File name -->
<span class="files-list__row-name-text">
<!-- Keep the displayName stuck to the extension to avoid whitespace rendering issues-->
diff --git a/apps/files/src/components/FileEntryGrid.vue b/apps/files/src/components/FileEntryGrid.vue
index 26fca69911e..8238c1a53d1 100644
--- a/apps/files/src/components/FileEntryGrid.vue
+++ b/apps/files/src/components/FileEntryGrid.vue
@@ -32,6 +32,7 @@
:dragover="dragover"
:grid-mode="true"
:source="source"
+ @auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
<FileEntryName ref="name"
@@ -41,7 +42,8 @@
:grid-mode="true"
:nodes="nodes"
:source="source"
- @click="execDefaultAction" />
+ @auxclick.native="execDefaultAction"
+ @click.native="execDefaultAction" />
</td>
<!-- Actions -->
diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts
index b1f564cdd4b..4f6c0899910 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -207,7 +207,8 @@ export default defineComponent({
},
execDefaultAction(event) {
- if (event.ctrlKey || event.metaKey) {
+ // if ctrl+click or middle mouse button, open in new tab
+ if (event.ctrlKey || event.metaKey || event.button === 1) {
event.preventDefault()
window.open(generateUrl('/f/{fileId}', { fileId: this.fileid }))
return false