Skip to content

Commit

Permalink
Merge pull request #42632 from nextcloud/backport/stable28/42507/Fix/…
Browse files Browse the repository at this point in the history
…files/42460/breadcrumb-conditional-rendering

[stable28] fix(files): kept only first and last breadcrumb titles
  • Loading branch information
emoral435 committed Jan 8, 2024
2 parents dba7369 + 3ca9473 commit e005e6c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
16 changes: 13 additions & 3 deletions apps/files/src/components/BreadCrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 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.

0 comments on commit e005e6c

Please sign in to comment.