Skip to content

Commit 9869fce

Browse files
authored
Merge pull request #2440 from nextcloud/bugfix/2148-2284
2 parents d559482 + d853653 commit 9869fce

5 files changed

Lines changed: 35 additions & 23 deletions

File tree

src/App.vue

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
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">
@@ -34,15 +34,16 @@
3434
</Modal>
3535

3636
<router-view v-show="!cardDetailsInModal || !$route.params.cardId" name="sidebar" />
37-
</div>
37+
</Content>
3838
</template>
3939

4040
<script>
4141
4242
import { mapState } from 'vuex'
4343
import AppNavigation from './components/navigation/AppNavigation'
44-
import { Modal } from '@nextcloud/vue'
44+
import { Modal, Content, AppContent } from '@nextcloud/vue'
4545
import { BoardApi } from './services/BoardApi'
46+
import { emit, subscribe } from '@nextcloud/event-bus'
4647
4748
const 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' })

src/components/Controls.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222

2323
<template>
2424
<div class="controls">
25-
<div id="app-navigation-toggle-custom" class="icon-menu" @click="toggleNav" />
26-
<div v-if="board" class="board-title">
25+
<div v-if="overviewName" class="board-title">
26+
<div class="board-bullet icon-calendar-dark" />
27+
<h2>{{ overviewName }}</h2>
28+
</div>
29+
<div v-else-if="board" class="board-title">
2730
<div :style="{backgroundColor: '#' + board.color}" class="board-bullet" />
28-
<h2><a href="#">{{ board.title }}</a></h2>
31+
<h2>{{ board.title }}</h2>
2932
<p v-if="showArchived">
3033
({{ t('deck', 'Archived cards') }})
3134
</p>
3235
</div>
33-
<div v-if="overviewName" class="board-title">
34-
<h2><a href="#">{{ overviewName }}</a></h2>
35-
</div>
3636
<div v-if="board" class="board-actions">
3737
<div v-if="canManage && !showArchived && !board.archived"
3838
id="stack-add"
@@ -321,6 +321,9 @@ export default {
321321
<style lang="scss" scoped>
322322
.controls {
323323
display: flex;
324+
padding: 3px;
325+
height: 44px;
326+
padding-left: 44px;
324327
325328
.board-title {
326329
display: flex;
@@ -337,7 +340,7 @@ export default {
337340
height: 20px;
338341
border: none;
339342
border-radius: 50%;
340-
background-color: #aaa;
343+
background-color: transparent;
341344
margin: 12px;
342345
margin-left: -4px;
343346
}

src/components/board/Board.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export default {
181181
}
182182
183183
.board {
184-
margin-left: $board-spacing;
184+
padding-left: $board-spacing;
185185
position: relative;
186186
height: calc(100% - 44px);
187187
overflow-x: scroll;

src/components/navigation/AppNavigation.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,4 @@ export default {
192192
color: var(--color-text-light);
193193
}
194194
}
195-
196-
::v-deep .app-navigation-toggle {
197-
display: none;
198-
}
199195
</style>

src/store/main.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default new Vuex.Store({
5858
state: {
5959
config: loadState('deck', 'config', {}),
6060
showArchived: false,
61-
navShown: true,
61+
navShown: localStorage.getItem('deck.navShown') === 'true',
6262
compactMode: localStorage.getItem('deck.compactMode') === 'true',
6363
cardDetailsInModal: localStorage.getItem('deck.cardDetailsInModal') === 'true',
6464
sidebarShown: false,
@@ -203,8 +203,9 @@ export default new Vuex.Store({
203203
return board.id !== b.id
204204
})
205205
},
206-
toggleNav(state) {
207-
state.navShown = !state.navShown
206+
toggleNav(state, navState) {
207+
state.navShown = navState
208+
localStorage.setItem('deck.navShown', navState)
208209
},
209210
toggleSidebar(state) {
210211
state.sidebarShown = !state.sidebarShown
@@ -408,8 +409,8 @@ export default new Vuex.Store({
408409
setBoardFilter({ commmit }, filter) {
409410
commmit('setBoardFilter', filter)
410411
},
411-
toggleNav({ commit }) {
412-
commit('toggleNav')
412+
toggleNav({ commit }, navState) {
413+
commit('toggleNav', navState)
413414
},
414415
toggleSidebar({ commit }) {
415416
commit('toggleSidebar')

0 commit comments

Comments
 (0)