Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(files): also trigger new tab on file name middle click
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
skjnldsv authored and nextcloud-command committed Jun 12, 2024
commit a094ac0b6d61a8aefa92517549c615dfc43430a2
4 changes: 3 additions & 1 deletion apps/files/src/components/FileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<FileEntryPreview ref="preview"
:source="source"
:dragover="dragover"
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />

<FileEntryName ref="name"
Expand All @@ -38,7 +39,8 @@
:files-list-width="filesListWidth"
:nodes="nodes"
:source="source"
@click="execDefaultAction" />
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
</td>

<!-- Actions -->
Expand Down
3 changes: 1 addition & 2 deletions apps/files/src/components/FileEntry/FileEntryName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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-->
Expand Down
4 changes: 3 additions & 1 deletion apps/files/src/components/FileEntryGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
:dragover="dragover"
:grid-mode="true"
:source="source"
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />

<FileEntryName ref="name"
Expand All @@ -41,7 +42,8 @@
:grid-mode="true"
:nodes="nodes"
:source="source"
@click="execDefaultAction" />
@auxclick.native="execDefaultAction"
@click.native="execDefaultAction" />
</td>

<!-- Actions -->
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/components/FileEntryMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 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.