Merge pull request #42632 from nextcloud/backport/stable28/42507/Fix/files/42460/breadcrumb-conditional-rendering

[stable28] fix(files): kept only first and last breadcrumb titles
This commit is contained in:
Eduardo Morales 2024-01-08 15:19:59 -06:00 committed by GitHub
commit e005e6c958
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 6 deletions

View file

@ -8,7 +8,8 @@
v-bind="section"
dir="auto"
:to="section.to"
:title="titleForSection(section)"
:title="titleForSection(index, section)"
:aria-description="ariaForSection(index, section)"
@click.native="onClick(section.to)">
<template v-if="index === 0" #icon>
<Home :size="20"/>
@ -108,11 +109,20 @@ export default Vue.extend({
}
},
titleForSection(section) {
titleForSection(index, section) {
if (section?.to?.query?.dir === this.$route.query.dir) {
return t('files', 'Reload current directory')
} else if (index === 0) {
return t('files', 'Go to the "{dir}" directory', section)
}
return t('files', 'Go to the "{dir}" directory', section)
return null
},
ariaForSection(index, section) {
if (index === section.length - 1) {
return t('files', 'Reload current directory')
}
return null
},
t,

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