diff --git a/apps/files/src/components/FilesAppBar.vue b/apps/files/src/components/FilesAppBar.vue index 41ee11c3f48..0dedbba3d1b 100644 --- a/apps/files/src/components/FilesAppBar.vue +++ b/apps/files/src/components/FilesAppBar.vue @@ -1,5 +1,5 @@ @@ -32,21 +36,20 @@ import 'inert-polyfill' import { mapGetters, mapState, mapActions } from 'vuex' import TopBar from './components/Top-Bar.vue' -import Menu from './components/Menu.vue' import MessageBar from './components/MessageBar.vue' import SkipTo from './components/SkipTo.vue' export default { components: { MessageBar, - 'side-menu': Menu, TopBar, SkipTo }, data() { return { appNavigationVisible: false, - $_notificationsInterval: null + $_notificationsInterval: null, + windowWidth: 0 } }, computed: { @@ -73,7 +76,22 @@ export default { return list.flat() }, - appNavigationEntries() { + showHeader() { + return this.$route.meta.hideHeadbar !== true + }, + favicon() { + return this.configuration.theme.logo.favicon + }, + + logoImage() { + return `/themes/${this.configuration.theme.name}/assets/logo.png` + }, + + productName() { + return this.configuration.theme.general.name + }, + + navItems() { if (this.publicPage()) { return [] } @@ -85,24 +103,36 @@ export default { return [] } - return items.filter(item => { - if (item.enabled === undefined) { - return true - } - + items.filter(item => { if (this.capabilities === undefined) { return false } + if (item.enabled === undefined) { + return true + } + return item.enabled(this.capabilities) }) + + return items.map(item => { + item.name = this.$gettext(item.name) + item.active = this.$route.name === item.route.name + + return item + }) }, - showHeader() { - return this.$route.meta.hideHeadbar !== true + sidebarClasses() { + if (this.appNavigationVisible) { + return '' + } + + return 'uk-visible@l' }, - favicon() { - return this.configuration.theme.logo.favicon + + isSidebarFixed() { + return this.windowWidth <= 960 } }, watch: { @@ -126,11 +156,17 @@ export default { } } }, + + beforeDestroy() { + window.removeEventListener('resize', this.onResize) + }, + destroyed() { if (this.$_notificationsInterval) { clearInterval(this.$_notificationsInterval) } }, + metaInfo() { const metaInfo = { title: this.configuration.theme.general.name @@ -140,9 +176,18 @@ export default { } return metaInfo }, + + mounted() { + this.$nextTick(() => { + window.addEventListener('resize', this.onResize) + this.onResize() + }) + }, + beforeMount() { this.initAuth() }, + methods: { ...mapActions(['initAuth', 'fetchNotifications', 'deleteMessage']), @@ -163,6 +208,17 @@ export default { $_deleteMessage(item) { this.deleteMessage(item) + }, + + onResize() { + const width = window.innerWidth + + // Reset navigation visibility in case of switching back to permanently visible sidebar + if (width >= 1200) { + this.appNavigationVisible = false + } + + this.windowWidth = width } } } diff --git a/src/components/ApplicationsMenu.vue b/src/components/ApplicationsMenu.vue index e0940797a7e..9754aa53837 100644 --- a/src/components/ApplicationsMenu.vue +++ b/src/components/ApplicationsMenu.vue @@ -1,13 +1,14 @@ - - - - diff --git a/src/components/Notifications.vue b/src/components/Notifications.vue index bf4ee8a13a4..2e509e33501 100644 --- a/src/components/Notifications.vue +++ b/src/components/Notifications.vue @@ -1,10 +1,9 @@ -TODO: Move to ODS and enable theming diff --git a/src/components/UserMenu.vue b/src/components/UserMenu.vue index 16018a7389d..4edc5a81d24 100644 --- a/src/components/UserMenu.vue +++ b/src/components/UserMenu.vue @@ -4,17 +4,17 @@ id="_userMenuButton" ref="menuButton" class="oc-topbar-personal uk-height-1-1" - variation="primary" + variation="raw" :aria-label="$gettext('User Menu')" > - + -
{{ userDisplayName }}
+