2121 -->
2222
2323<template >
24- <div id =" content" :class =" { 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }" >
25- <AppNavigation v-show = " navShown " />
26- <div id = " app-content " >
24+ <Content id =" content" app-name = " deck " :class =" { 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }" >
25+ <AppNavigation />
26+ <AppContent >
2727 <router-view />
28- </div >
28+ </AppContent >
2929
3030 <Modal v-if =" cardDetailsInModal && $route.params.cardId" :title =" t('deck', 'Card details')" @close =" hideModal()" >
3131 <div class =" modal__content modal__card" >
3434 </Modal >
3535
3636 <router-view v-show =" !cardDetailsInModal || !$route.params.cardId" name =" sidebar" />
37- </div >
37+ </Content >
3838</template >
3939
4040<script >
4141
4242import { mapState } from ' vuex'
4343import AppNavigation from ' ./components/navigation/AppNavigation'
44- import { Modal } from ' @nextcloud/vue'
44+ import { Modal , Content , AppContent } from ' @nextcloud/vue'
4545import { BoardApi } from ' ./services/BoardApi'
46+ import { emit , subscribe } from ' @nextcloud/event-bus'
4647
4748const boardApi = new BoardApi ()
4849
@@ -51,6 +52,8 @@ export default {
5152 components: {
5253 AppNavigation,
5354 Modal,
55+ Content,
56+ AppContent,
5457 },
5558 data () {
5659 return {
@@ -91,6 +94,15 @@ export default {
9194 this .$store .dispatch (' loadBoards' )
9295 this .$store .dispatch (' loadSharees' )
9396 },
97+ mounted () {
98+ // Set navigation to initial state and update in case it gets toggled
99+ emit (' toggle-navigation' , { open: this .navShown , _initial: true })
100+ this .$nextTick (() => {
101+ subscribe (' navigation-toggled' , (navState ) => {
102+ this .$store .dispatch (' toggleNav' , navState .open )
103+ })
104+ })
105+ },
94106 methods: {
95107 hideModal () {
96108 this .$router .push ({ name: ' board' })
0 commit comments