+
@@ -32,21 +41,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 +81,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 +108,52 @@ 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
+ },
+
+ isSidebarVisible() {
+ return this.windowWidth >= 1200 || this.appNavigationVisible
+ },
+
+ appNavigationAnimation() {
+ if (this.windowWidth > 1200) {
+ return null
+ }
+
+ if (this.windowWidth > 960) {
+ return 'push-right'
+ }
+
+ return 'fade'
}
},
watch: {
@@ -126,11 +177,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 +197,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 +229,25 @@ 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
+ },
+
+ handleNavSwipe() {
+ if (this.windowWidth <= 960 || this.windowWidth > 1200) {
+ return
+ }
+
+ this.appNavigationVisible = false
}
}
}
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 @@
-
+
+ >
+
+
-
- {{ translateMenu(n) }}
-
-
-
-
-
-
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 @@
-
+
-
-
-
-
-
-
- ownCloud X
-
-
+
-
+
+
-TODO: Move to ODS and enable theming