diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-21 15:58:40 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-21 15:58:40 +0200 |
commit | 51f2f56b4bc9bd9883857563b9ada57bdb79ba2f (patch) | |
tree | 29a479f7673ae834acfcf98e7e20bae11da3ef0a /apps/files | |
parent | a5a5c09f58ffae012eaea7fa0b24d46ebaae1c0c (diff) | |
download | nextcloud-server-51f2f56b4bc9bd9883857563b9ada57bdb79ba2f.tar.gz nextcloud-server-51f2f56b4bc9bd9883857563b9ada57bdb79ba2f.zip |
fix(files): do not execute the default action on folders
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index d4258f29861..8dc067a407d 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -262,6 +262,15 @@ export default Vue.extend({ }, linkTo() { + if (this.source.type === 'folder') { + const to = { ...this.$route, query: { dir: join(this.dir, this.source.basename) } } + return { + is: 'router-link', + title: this.t('files', 'Open folder {name}', { name: this.displayName }), + to, + } + } + if (this.enabledDefaultActions.length > 0) { const action = this.enabledDefaultActions[0] const displayName = action.displayName([this.source], this.currentView) @@ -271,14 +280,6 @@ export default Vue.extend({ } } - if (this.source.type === 'folder') { - const to = { ...this.$route, query: { dir: join(this.dir, this.source.basename) } } - return { - is: 'router-link', - title: this.t('files', 'Open folder {name}', { name: this.displayName }), - to, - } - } return { href: this.source.source, // TODO: Use first action title ? @@ -525,6 +526,11 @@ export default Vue.extend({ } }, execDefaultAction(event) { + // Do not execute the default action on the folder, navigate instead + if (this.source.type === 'folder') { + return + } + if (this.enabledDefaultActions.length > 0) { event.preventDefault() event.stopPropagation() |