fix: Hide navigation initially on mobile
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import AppNavigation from './components/navigation/AppNavigation.vue'
|
import AppNavigation from './components/navigation/AppNavigation.vue'
|
||||||
import KeyboardShortcuts from './components/KeyboardShortcuts.vue'
|
import KeyboardShortcuts from './components/KeyboardShortcuts.vue'
|
||||||
import { NcModal, NcContent, NcAppContent } from '@nextcloud/vue'
|
import { NcModal, NcContent, NcAppContent, isMobile } from '@nextcloud/vue'
|
||||||
import { BoardApi } from './services/BoardApi.js'
|
import { BoardApi } from './services/BoardApi.js'
|
||||||
import { emit, subscribe } from '@nextcloud/event-bus'
|
import { emit, subscribe } from '@nextcloud/event-bus'
|
||||||
import { loadState } from '@nextcloud/initial-state'
|
import { loadState } from '@nextcloud/initial-state'
|
||||||
@@ -51,6 +51,7 @@ export default {
|
|||||||
NcAppContent,
|
NcAppContent,
|
||||||
KeyboardShortcuts,
|
KeyboardShortcuts,
|
||||||
},
|
},
|
||||||
|
mixins: [isMobile],
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
boardApi,
|
boardApi,
|
||||||
@@ -107,7 +108,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// Set navigation to initial state and update in case it gets toggled
|
// Set navigation to initial state and update in case it gets toggled
|
||||||
emit('toggle-navigation', { open: this.navShown, _initial: true })
|
emit('toggle-navigation', { open: !this.isMobile && this.navShown, _initial: true })
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
subscribe('navigation-toggled', (navState) => {
|
subscribe('navigation-toggled', (navState) => {
|
||||||
this.$store.dispatch('toggleNav', navState.open)
|
this.$store.dispatch('toggleNav', navState.open)
|
||||||
|
|||||||
Reference in New Issue
Block a user