mirror of
https://github.com/nextcloud/server.git
synced 2026-03-22 10:30:49 -04:00
feat(files): allow hidden views
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
b2d0b4adeb
commit
2c65bd2f4b
1 changed files with 6 additions and 2 deletions
|
|
@ -89,7 +89,7 @@ export default defineComponent({
|
|||
return (Object.values(this.views).reduce((acc, views) => [...acc, ...views], []) as View[])
|
||||
.filter(view => view.params?.dir.startsWith(this.parent.params?.dir))
|
||||
}
|
||||
return this.views[this.parent.id] ?? [] // Root level views have `undefined` parent ids
|
||||
return this.filterVisible(this.views[this.parent.id] ?? [])
|
||||
},
|
||||
|
||||
style() {
|
||||
|
|
@ -103,11 +103,15 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
methods: {
|
||||
filterVisible(views: View[]) {
|
||||
return views.filter(({ _view, id }) => id === this.currentView?.id || _view.hidden !== true)
|
||||
},
|
||||
|
||||
hasChildViews(view: View): boolean {
|
||||
if (this.level >= maxLevel) {
|
||||
return false
|
||||
}
|
||||
return this.views[view.id]?.length > 0
|
||||
return this.filterVisible(this.views[view.id] ?? []).length > 0
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue