Merge pull request #2440 from nextcloud/bugfix/2148-2284
This commit is contained in:
24
src/App.vue
24
src/App.vue
@@ -21,11 +21,11 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="content" :class="{ 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }">
|
<Content id="content" app-name="deck" :class="{ 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }">
|
||||||
<AppNavigation v-show="navShown" />
|
<AppNavigation />
|
||||||
<div id="app-content">
|
<AppContent>
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</AppContent>
|
||||||
|
|
||||||
<Modal v-if="cardDetailsInModal && $route.params.cardId" :title="t('deck', 'Card details')" @close="hideModal()">
|
<Modal v-if="cardDetailsInModal && $route.params.cardId" :title="t('deck', 'Card details')" @close="hideModal()">
|
||||||
<div class="modal__content modal__card">
|
<div class="modal__content modal__card">
|
||||||
@@ -34,15 +34,16 @@
|
|||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<router-view v-show="!cardDetailsInModal || !$route.params.cardId" name="sidebar" />
|
<router-view v-show="!cardDetailsInModal || !$route.params.cardId" name="sidebar" />
|
||||||
</div>
|
</Content>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import AppNavigation from './components/navigation/AppNavigation'
|
import AppNavigation from './components/navigation/AppNavigation'
|
||||||
import { Modal } from '@nextcloud/vue'
|
import { Modal, Content, AppContent } from '@nextcloud/vue'
|
||||||
import { BoardApi } from './services/BoardApi'
|
import { BoardApi } from './services/BoardApi'
|
||||||
|
import { emit, subscribe } from '@nextcloud/event-bus'
|
||||||
|
|
||||||
const boardApi = new BoardApi()
|
const boardApi = new BoardApi()
|
||||||
|
|
||||||
@@ -51,6 +52,8 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
AppNavigation,
|
AppNavigation,
|
||||||
Modal,
|
Modal,
|
||||||
|
Content,
|
||||||
|
AppContent,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -91,6 +94,15 @@ export default {
|
|||||||
this.$store.dispatch('loadBoards')
|
this.$store.dispatch('loadBoards')
|
||||||
this.$store.dispatch('loadSharees')
|
this.$store.dispatch('loadSharees')
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
// Set navigation to initial state and update in case it gets toggled
|
||||||
|
emit('toggle-navigation', { open: this.navShown, _initial: true })
|
||||||
|
this.$nextTick(() => {
|
||||||
|
subscribe('navigation-toggled', (navState) => {
|
||||||
|
this.$store.dispatch('toggleNav', navState.open)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$router.push({ name: 'board' })
|
this.$router.push({ name: 'board' })
|
||||||
|
|||||||
@@ -22,17 +22,17 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div id="app-navigation-toggle-custom" class="icon-menu" @click="toggleNav" />
|
<div v-if="overviewName" class="board-title">
|
||||||
<div v-if="board" class="board-title">
|
<div class="board-bullet icon-calendar-dark" />
|
||||||
|
<h2>{{ overviewName }}</h2>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="board" class="board-title">
|
||||||
<div :style="{backgroundColor: '#' + board.color}" class="board-bullet" />
|
<div :style="{backgroundColor: '#' + board.color}" class="board-bullet" />
|
||||||
<h2><a href="#">{{ board.title }}</a></h2>
|
<h2>{{ board.title }}</h2>
|
||||||
<p v-if="showArchived">
|
<p v-if="showArchived">
|
||||||
({{ t('deck', 'Archived cards') }})
|
({{ t('deck', 'Archived cards') }})
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="overviewName" class="board-title">
|
|
||||||
<h2><a href="#">{{ overviewName }}</a></h2>
|
|
||||||
</div>
|
|
||||||
<div v-if="board" class="board-actions">
|
<div v-if="board" class="board-actions">
|
||||||
<div v-if="canManage && !showArchived && !board.archived"
|
<div v-if="canManage && !showArchived && !board.archived"
|
||||||
id="stack-add"
|
id="stack-add"
|
||||||
@@ -321,6 +321,9 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.controls {
|
.controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
padding: 3px;
|
||||||
|
height: 44px;
|
||||||
|
padding-left: 44px;
|
||||||
|
|
||||||
.board-title {
|
.board-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -337,7 +340,7 @@ export default {
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: #aaa;
|
background-color: transparent;
|
||||||
margin: 12px;
|
margin: 12px;
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.board {
|
.board {
|
||||||
margin-left: $board-spacing;
|
padding-left: $board-spacing;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: calc(100% - 44px);
|
height: calc(100% - 44px);
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
|
|||||||
@@ -192,8 +192,4 @@ export default {
|
|||||||
color: var(--color-text-light);
|
color: var(--color-text-light);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .app-navigation-toggle {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default new Vuex.Store({
|
|||||||
state: {
|
state: {
|
||||||
config: loadState('deck', 'config', {}),
|
config: loadState('deck', 'config', {}),
|
||||||
showArchived: false,
|
showArchived: false,
|
||||||
navShown: true,
|
navShown: localStorage.getItem('deck.navShown') === 'true',
|
||||||
compactMode: localStorage.getItem('deck.compactMode') === 'true',
|
compactMode: localStorage.getItem('deck.compactMode') === 'true',
|
||||||
cardDetailsInModal: localStorage.getItem('deck.cardDetailsInModal') === 'true',
|
cardDetailsInModal: localStorage.getItem('deck.cardDetailsInModal') === 'true',
|
||||||
sidebarShown: false,
|
sidebarShown: false,
|
||||||
@@ -203,8 +203,9 @@ export default new Vuex.Store({
|
|||||||
return board.id !== b.id
|
return board.id !== b.id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toggleNav(state) {
|
toggleNav(state, navState) {
|
||||||
state.navShown = !state.navShown
|
state.navShown = navState
|
||||||
|
localStorage.setItem('deck.navShown', navState)
|
||||||
},
|
},
|
||||||
toggleSidebar(state) {
|
toggleSidebar(state) {
|
||||||
state.sidebarShown = !state.sidebarShown
|
state.sidebarShown = !state.sidebarShown
|
||||||
@@ -408,8 +409,8 @@ export default new Vuex.Store({
|
|||||||
setBoardFilter({ commmit }, filter) {
|
setBoardFilter({ commmit }, filter) {
|
||||||
commmit('setBoardFilter', filter)
|
commmit('setBoardFilter', filter)
|
||||||
},
|
},
|
||||||
toggleNav({ commit }) {
|
toggleNav({ commit }, navState) {
|
||||||
commit('toggleNav')
|
commit('toggleNav', navState)
|
||||||
},
|
},
|
||||||
toggleSidebar({ commit }) {
|
toggleSidebar({ commit }) {
|
||||||
commit('toggleSidebar')
|
commit('toggleSidebar')
|
||||||
|
|||||||
Reference in New Issue
Block a user