Skip to content

Commit

Permalink
Merge pull request #43325 from arublov/feature/hide-breadcrumbs-uploa…
Browse files Browse the repository at this point in the history
…d-and-overlap
  • Loading branch information
skjnldsv authored Feb 26, 2024
2 parents 3f26978 + 66f55d5 commit 027895f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions apps/files/src/components/BreadCrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
:aria-label="t('files', 'Current directory path')">
<!-- Current path sections -->
<NcBreadcrumb v-for="(section, index) in sections"
v-show="shouldShowBreadcrumbs"
:key="section.dir"
v-bind="section"
dir="auto"
Expand Down Expand Up @@ -60,6 +61,8 @@ import { defineComponent } from 'vue'

import { useFilesStore } from '../store/files.ts'
import { usePathsStore } from '../store/paths.ts'
import { useUploaderStore } from '../store/uploader.ts'
import filesListWidthMixin from '../mixins/filesListWidth.ts'

export default defineComponent({
name: 'BreadCrumbs',
Expand All @@ -78,12 +81,19 @@ export default defineComponent({
},
},

mixins: [
filesListWidthMixin,
],

setup() {
const filesStore = useFilesStore()
const pathsStore = usePathsStore()
const uploaderStore = useUploaderStore()

return {
filesStore,
pathsStore,
uploaderStore,
}
},

Expand Down Expand Up @@ -113,6 +123,15 @@ export default defineComponent({
}
})
},

isUploadInProgress(): boolean {
return this.uploaderStore.queue.length !== 0
},

// Hide breadcrumbs if an upload is ongoing on arrow screens
shouldShowBreadcrumbs(): boolean {
return this.filesListWidth < 768 && !this.isUploadInProgress
},
},

methods: {
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 027895f

Please sign in to comment.