mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix(files): do not execute the default action on folders
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
a5a5c09f58
commit
51f2f56b4b
1 changed files with 14 additions and 8 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue