Skip to content

Commit

Permalink
Add a button to the modal to switch back to the sidebar view
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Röhrl <[email protected]>
  • Loading branch information
jakobroehrl committed Jul 17, 2020
1 parent 4685ecd commit 5b6f8b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export default {
},
methods: {
hideModal() {
// this.$store.dispatch('setCardDetailsInModal', false)
this.$router.push({ name: 'board' })
},
},
Expand Down
14 changes: 13 additions & 1 deletion src/components/card/CardSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
<AppSidebar v-if="currentBoard && currentCard && copiedCard"
:title="currentCard.title"
:subtitle="subtitle"
:class="{ 'app-sidebar-modal': cardDetailsInModal}"
@close="closeSidebar">
<template #secondary-actions>
<ActionButton icon="icon-external" @click.stop="showModal()">
<ActionButton v-if="cardDetailsInModal" icon="icon-menu-sidebar" @click.stop="showModal()">
{{ t('deck', 'Open in sidebar view') }}
</ActionButton>

<ActionButton v-else icon="icon-external" @click.stop="showModal()">
{{ t('deck', 'Open in bigger view') }}
</ActionButton>
</template>
Expand Down Expand Up @@ -139,6 +144,7 @@ export default {
computed: {
...mapState({
currentBoard: state => state.currentBoard,
cardDetailsInModal: state => state.cardDetailsInModal,
}),
...mapGetters(['canEdit', 'assignables']),
attachments() {
Expand Down Expand Up @@ -384,6 +390,12 @@ export default {
</style>

<style lang="scss" scoped>
.app-sidebar-modal {
border-left: 0;
width: 800px;
max-width: 780px;
top: 0px;
}

h5 {
border-bottom: 1px solid var(--color-border);
Expand Down

0 comments on commit 5b6f8b6

Please sign in to comment.