Merge pull request #45571 from nextcloud/fix/files-middle-click

This commit is contained in:
John Molakvoæ 2024-06-12 16:31:09 +02:00 committed by GitHub
commit 6ec6c1fe4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 13 additions and 9 deletions

View file

@ -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 -->

View file

@ -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-->

View file

@ -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 -->

View file

@ -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

6
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