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>

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2024-05-29 18:53:53 +02:00 committed by nextcloud-command
parent b9857b9a7f
commit 63ca843105
6 changed files with 12 additions and 8 deletions

View file

@ -47,6 +47,7 @@
<FileEntryPreview ref="preview"
:source="source"
:dragover="dragover"
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
<FileEntryName ref="name"
@ -55,7 +56,8 @@
:files-list-width="filesListWidth"
:nodes="nodes"
:source="source"
@click="execDefaultAction" />
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
</td>
<!-- Actions -->

View file

@ -43,8 +43,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-->

View file

@ -49,6 +49,7 @@
:dragover="dragover"
:grid-mode="true"
:source="source"
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
<FileEntryName ref="name"
@ -58,7 +59,8 @@
:grid-mode="true"
:nodes="nodes"
:source="source"
@click="execDefaultAction" />
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
</td>
<!-- Actions -->

View file

@ -224,7 +224,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

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long